## Check if linked list is sorted (Iterative and Recursive)

Given a Linked List, task is to check whether the Linked List is sorted in Descending order or not? Examples : Input : 8 ->… Read More »

- Print all permutations of a string in Java
- Check if a word exists in a grid or not
- Print the last k nodes of the linked list in reverse order | Recursive approach
- Java Program to print distinct permutations of a string
- Recursive program to print all subsets with given sum
- Double Knapsack | Dynamic Programming
- Generate all the binary strings of N bits
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Sum of nodes at maximum depth of a Binary Tree | Set 2
- Sum of the series 1^1 + 2^2 + 3^3 + ..... + n^n using recursion
- Count all Grandparent-Parent-Child Triplets in a binary tree whose sum is greater than X
- Print all subsequences of a string using ArrayList
- Minimum number of cubes whose sum equals to given number N
- Print all paths from top left to bottom right in a matrix with four moves allowed
- Find the value of ln(N!) using Recursion
- Programs for printing pyramid patterns using recursion
- Detect cycle in the graph using degrees of nodes of graph
- Longest Ordered Subsequence of Vowels
- Print Stack Elements from Bottom to Top
- Split the array into equal sum parts according to given conditions
- Algorithms | Recurrences | Set 1
- Count number of ways to reach a given score in a Matrix
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Recursive Program for Binary to Decimal
- Print path from root to all nodes in a Complete Binary Tree
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Maximum sum of non-overlapping subarrays of length atmost K
- Find the node with maximum value in a Binary Search Tree using recursion
- Modify contents of Linked List - Recursive approach
- Number of subsets with zero sum

Given a Linked List, task is to check whether the Linked List is sorted in Descending order or not? Examples : Input : 8 ->… Read More »

Given a queue, write a recursive function to reverse it. Standard operations allowed : enqueue(x) : Add an item x to rear of queue. dequeue()… Read More »

Given three positive integer n, s and k. The task is to print all possible sequence of length s, starting with n and the absolute… Read More »

Given an array arr[] and an index in it. Find whether the array arr[] can be partitioned into two disjoint sets such that sum of… Read More »

Given a stack with push(), pop(), empty() operations, delete middle of it without using any additional data structure. Input : Stack[] = [1, 2, 3,… Read More »

Basics – Recursion Recursive Functions Tail Recursion Strings – Given a string, print all possible palindromic partitions Check if a number is Palindrome Print all… Read More »

Given two strings, copy one string to other using recursion. We basically need to write our own recursive version of strcpy in C/C++ Examples: Input… Read More »

This article is about generating Power set in lexicographical order. Examples : Input : abc Output : a ab abc ac b bc c Recommended:… Read More »

Given a singly linked list and the task is to find middle of linked list. Examples: Input : 1->2->3->4->5 Output : 3 Input : 1->2->3->4->5->6… Read More »

Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire… Read More »

Partition given string in such manner that i’th substring is sum of (i-1)’th and (i-2)’nd substring. Examples: Input : “11235813” Output : [“1”, “1”, “2”,… Read More »

Given n, of a n x n chessboard, find the proper placement of queens on chessboard. Previous Approach : N Queen Recommended: Please try your… Read More »

Given Preorder traversal of a Binary Search Tree. Then the task is print leaf nodes of the Binary Search Tree from the given preorder. Examples… Read More »

Given a number n, check whether it’s prime number or not using recursion. Examples: Input : n = 11 Output : Yes Input : n… Read More »

Given a linked list, split the linked list into two with alternate nodes. Examples: Input : 1 2 3 4 5 6 7 Output :… Read More »