In this post, we will see how to detect cycle in a a linked list using Hashing and Floyd’s Cycle Detection Algorithm.
Write a function that takes two lists, each of which is sorted in increasing order, and merges the two together into one list which is in decreasing order and return it. In other words, merge two sorted linked lists from their end.
Given a linked list, reverse every adjacent group of k nodes in it where k is given positive integer.
In this post, we will see how to reverse linked list using recursion in C and C++.
In this post, we will see how to reverse linked list iteratively without using recursion.
Given two lists sorted in increasing order, create and return a new list representing the intersection of the two lists. The new list should be made with its own memory — the original lists should not be changed.
Write a function that takes two lists, each of which is sorted in increasing order, and merges the two together into one list which is in increasing order and return it.
Given a linked list sorted in increasing order, write a function which removes any duplicate nodes from the list by traversing the list only once.
Given a positive integer N, count all N-digit binary strings without any consecutive 1’s.
Given a M x N matrix where each cell have non-negative cost associated with it, count number of paths to reach last cell (M-1, N-1) of the matrix from its first cell (0, 0) such that path has given cost. We can only move one unit right or one unit down from any cell. i.e. …
The Longest Palindromic Subsequence (LPS) problem is the problem of finding the longest subsequences of a string that is also a palindrome.
Given a string sorted in ascending order, find all lexicographically next permutations of it.