## Rearrange the Array of Given Range N, such that A[i]=i

Algorithms – Rearrange the Array of Given Range N, such that A[i]=i. Objective: Given a array of length N, in which elements are in the range of 1 to N. All elements may not...

Skip to content# Tagged: Intermediate

## Rearrange the Array of Given Range N, such that A[i]=i

## Print All Paths From Root In a Binary Tree Whose Sum is Equal to a Given Number

## Reverse Level Order Traversal

## Find the Deepest Node in a Binary Tree.

## Find the Height of a tree without Recursion

## Find All the Well Ordered Permutations of a Given String.

## Find Increasing Triplet Sub-sequence

## Track the Maximum Element in a Stack.

## Counting Sort

## Generate All Strings of n bits.

## Implement Queue Using Stacks

## Alternate Splitting of a given Linked List

## Reverse The Doubly Linked List

## Swap Kth Node from the front with the Kth Node from the End

## Print the Bottom View of the Binary Tree.

@tutorialhorizon

Algorithms – Rearrange the Array of Given Range N, such that A[i]=i. Objective: Given a array of length N, in which elements are in the range of 1 to N. All elements may not...

Objective: – Given a binary tree and X, write an algorithm to Print all the paths starting from root so that sum of all the nodes in path equals to a given number. Example:

Objective: – Given a binary tree, Do the reverse level order traversal. In our earlier post we have seen normal Level Order Traversal. In reverse level order traversal we first need to print the...

Objective: – Given a binary tree, write an algorithm to Find the deepest node in it. Approach: Take two global variable as “deepestlevel” and “value“. starting with level=0, Do the inorder traversal and whenever...

Objective: – Find the Height of a tree without Recursion. In our earlier post “Height of tree” we had used recursion to find it. In this post we will see how to find it...

Objective: Write an algorithm to Print All the Well Ordered Permutations of a Given String. What is Well Ordered String: When all the alphabets in a string occur in the increasing order irrespective of...

Objective: Given an integer array A[1..n], find an instance of i,j,k where 0 < i < j < k <= n and A[i] < A[j] < A[k]. Example : int arrA[] = { 10,...

Objective: In a Stack, keep track of maximum value in it. It might be the top element in the stack but once it is poped out, the maximum value should be from the rest...

Counting Sort is an sorting algorithm, which sorts the integers( or Objects) given in a specific range. Algorithm: Time Complexity O(n) Take two arrays, Count[] and Result[] and given array is input[]. Count[] will...

ObjecÂtive: – Generate All Strings of n bits, consider A[0..n-1] is an array of size n. Example : n = 3 Output: [0, 0, 0] [1, 0, 0] [0, 1, 0] [1, 1, 0]...

Objective: We know that Queue is FIFO (First-in-First-Out) and Stack is LIFO ( Last-in-First-Out). Here our objective is to implement queue using stacks. Approach: Take 2 Stacks, stack1 and stack2. stack1 will be used...

Objective: Given a singly linked list, split it into two linked lists. These linked lists will contain the alternate nodes from the given linked list. Example:

Objective: Reverse The Doubly Linked List. Example: Approach: Every Node in a doubly linked list has next and previous pointer. Do the linear traversal of the linked list and keep swapping the next and...

Objective: Given a Linked List and a number k, Swap Kth Node from the front with the Kth Node from the End Example: ->10->20->30->40->50->60->70 Swapping 1 Node from the Front and from the End...

ObjecÂtive: – Given a binary tree, print it in Bottom View of it. What is Bottom View: Bottom view means when you look the tree from the bottom the nodes you will see will be...

%d bloggers like this: