## Dynamic Programming — Longest Palindromic Subsequence

Objective: Given a string, find a longest palindromic subsequence in it. What is Longest Palindromic Subsequence: A longest palindromic subsequence … Read more

## Dynamic Programming – Maximum Product Cutting Problem.

Objective: Given a rope of length n meters, write an algorithm to cut the rope in such a way that … Read more

## Generate Well Ordered Passwords of a Given Length K

Objective: Generate Well Ordered Passwords of a Given Length K. Well ordered means that digits should be in increasing order … Read more

## The Word Break Problem

Objective: Given a string and a dictionary of words, find out if the input string can be broken into a … Read more

## Backtracking – Knight’s Tour Problem

Objective: A knight’s tour is a sequence of moves of a knight on a chessboard such that the knight visits … 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

## Reverse The Doubly Linked List

Objective: Reverse The Doubly Linked List. Example: Approach: Every Node in a doubly-linked list has the next and previous pointer. … 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.

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