Dynamic Programming – Stairs Climbing Puzzle

Objective: A child is climbing up a staircase with n steps, and can hop either 1 step, 2 steps, or … Read more

Dynamic Programming – Minimum Coin Change Problem

Objective: Given an amount of ‘A’ and n coins,   v1<v2<v3<………..<vn. Write a program to find out the minimum number of … Read more

Print All The Nodes Which are X distance from the Given Node

Objective: Given Binary Tree, Print All The Nodes Which are X distance from the Given Node.

Example :

Approach:

Quite Tricky solution, i will explain using the example given in the picture.
Find out all the nodes which are at distance ‘3’ from the given node 5.

Read more

Find Intersection Point in Two Linked List

Objective: Given Two linked lists, check whether both lists intersect each other, if yes then find the starting node of the intersection.

An intersection point means the end of one linked list is linked with some node in another linked list and it forms a Y shape.

Input: Two Linked List

Output: Intersection Node or point

Example:

Find Intersection Point in Two Linked List
Find Intersection Point in Two Linked List

Approach:

Read more