## Reverse The Doubly Linked List

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...

Skip to content# Tagged: Intermediate

## 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.

## Merge Sort in a Linked list

## Merge a Linked list into another Linked List at Alternate Positions.

## Print The Top View of a Binary Tree

## Check if Array Contains All Elements Of Some Given Range

## Find the subarray with sum to a Given Value.

## In an Array, find the Smallest Subarray with Sum Greater than the Given Value

## Find Kth Smallest or Largest element in an Array.

## Given an array arrA[], find the maximum j – i such that arr[j] > arr[i].

## Search an Element in a Rotated Sorted Array

## Print All The Nodes Which are X distance from the Leaf Nodes

## Print All The Nodes Which are X distance from the Root

## Find The Distance From Root To Given Node of a Binary Tree.

@tutorialhorizon

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...

Objective: – 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...

Objective: Given a Linked List, Sort it using merge sort. Example: ->9->3->4->2->5->1 Sorted List: ->1->2->3->4->5->9 Approach: Reference : Merge Sort in array As it Merge sort, we apply the same logic , Divide and...

Objective: Given two linked lists, merge one list into another at alternate positions, if second link list has extra nodes, print them as well Example: 5 -> 10 -> 15 -> 20 ->25 ->...

Objective: – Given a binary tree, print it in Top View of it. What is Top View: Top view means when you look the tree from the top the nodes you will see will...

Objective: Given an array of unsorted numbers, check if it contains all elements of some given range. Examples: int[] arrA = { 11, 17, 13, 19, 15, 16, 12, 14 }; Range : 12-15...

Objective: Given an array (non-negative) and an integer, Find the Subarray whose sum is equal to the given integer. Examples: int[] arrA = { 25, 12, 14, 22, 19, 15, 10, 23 }; Integer...

Objective: Given an array and an integer, find the smallest subarray whose sum is greater than the given integer. Examples: arrA[] = { 1, 5, 20, 70, 8} Integer = 97 Output : Min...

Objective: Find Kth Smallest or Largest element in an Array Example: int[] arrA = { 2, 3, 11, 16, 27, 4, 15, 9, 8 }; Output: The 4th smallest element is : 8 Approach:...

Objective: Given an array arrA[], find the maximum j – i such that arr[j] > arr[i]. Example: int[] arrA = { 12, 3, 1, 5, 6, 4, 10, 9, 8, 0 }; Output: Max(j-i)...

Input: Rotated Sorted Array. What is Rotated Sorted Array. A sorted array is rotated around some pivot element. See the Example Below, array is rotated after 6. Approach:

Objective: – Given Binary Tree, Print All The Nodes Which are X distance from the Leaf Nodes Example : Approach:

Objective: – Given Binary Tree, Print all the nodes which are X distance from the root Example : Appraoch:

Objective: – Find The Distance From Root To Given Node of a binary tree. What does Distance means : It means number of edges between two nodes. Approach:

%d bloggers like this: