- Find n-th node of inorder traversal
- Count numbers with unit digit k in given range
- Sort the words in lexicographical order in Python
- Maximum product of 4 adjacent elements in matrix
- Find largest sum of digits in all divisors of n
- Difference between sum of the squares of first n natural numbers and square of sum
- Number of non-negative integral solutions of sum equation
- Find the largest node in Doubly linked list
- Print the alternate nodes of linked list (Iterative Method)
- Program to Change RGB color model to HSV color model
- Minkowski distance in Python
- Find words which are greater than given length k
- Python | Play a video using OpenCV
- Python | Detect corner of an image using OpenCV
- Area of circle which is inscribed in equilateral triangle
- Box plot visualization with Pandas and Seaborn
- Python | Numpy nanmedian() function
- Python | numpy.nanmean() function
- Python | numpy.cov() function

- Majority Element
- Find the node with minimum value in a Binary Search Tree
- Write a program to Calculate Size of a tree | Recursion
- Write Code to Determine if Two Trees are Identical
- Write a program to Delete a Tree
- Convert a Binary Tree into its Mirror Tree
- Minimum number of jumps to reach end
- Given a binary tree, print out all of its root-to-leaf paths one per line.
- Lowest Common Ancestor in a Binary Search Tree.
- Merge an array of size n into another array of size m+n
- Given a string, find its first non-repeating character
- Check sum of Covered and Uncovered nodes of Binary Tree
- Compute the minimum or maximum of two integers without branching
- Level Order Tree Traversal
- Program to count leaf nodes in a binary tree
- A program to check if a binary tree is BST or not
- Level order traversal in spiral form
- Check for Children Sum Property in a Binary Tree
- Convert an arbitrary Binary Tree to a tree that holds Children Sum Property
- How to determine if a binary tree is height-balanced?
- Segregate 0s and 1s in an array
- Inorder Tree Traversal without Recursion
- Root to leaf path sum equal to a given number
- Construct Tree from given Inorder and Preorder traversals
- Given a binary tree, print all root-to-leaf paths
- Find the largest BST subtree in a given Binary Tree | Set 1
- Maximum width of a binary tree
- Next Greater Element
- Print nodes at k distance from root
- Connect nodes at same level
- Get Level of a node in a Binary Tree
- Print BST keys in the given range
- Print Ancestors of a given node in Binary Tree
- Find whether an array is subset of another array | Added Method 3
- Floor and Ceil from a BST
- Connect nodes at same level using constant extra space
- Sorted Array to Balanced BST
- Implement two stacks in an array
- Check whether two strings are anagram of each other
- Convert a given tree to its Sum Tree
- Merge Two Balanced Binary Search Trees
- Find the maximum sum leaf to root path in a Binary Tree
- Finite Automata algorithm for Pattern Searching
- Largest subarray with equal number of 0s and 1s
- Construct Special Binary Tree from given Inorder traversal
- Construct a special tree from given preorder traversal
- Boundary Traversal of binary tree
- Find the row with maximum number of 1s
- Print unique rows in a given boolean matrix
- Construct Full Binary Tree from given preorder and postorder traversals
- Construct BST from given preorder traversal | Set 1
- Construct BST from given preorder traversal | Set 2
- Longest Palindromic Substring | Set 2
- Iterative Preorder Traversal
- Convert a BST to a Binary Tree such that sum of all greater keys is added to every key
- Morris traversal for Preorder
- Find the first circular tour that visits all petrol pumps
- Generate n-bit Gray Codes
- Convert a given Binary Tree to Doubly Linked List | Set 1
- Largest Rectangular Area in a Histogram | Set 2
- Tree Isomorphism Problem
- Expression Evaluation
- Print ancestors of a given binary tree node without recursion
- Convert a given Binary Tree to Doubly Linked List | Set 2
- Difference between sums of odd level and even level nodes of a Binary Tree
- Print Postorder traversal from given Inorder and Preorder traversals
- Find depth of the deepest odd level leaf node
- Check if all leaves are at same level
- Print Left View of a Binary Tree
- Add all greater values to every node in a given BST
- Remove all nodes which don't lie in any path with sum>= k
- Deepest left leaf node in a binary tree
- Count all distinct pairs with difference equal to k
- Sum of all the numbers that are formed from root to leaf paths
- Print all ways to break a string in bracket form
- Convert a given Binary Tree to Doubly Linked List | Set 3
- Print all nodes that don't have sibling
- Lowest Common Ancestor in a Binary Tree | Set 1
- Find distance between two nodes of a Binary Tree
- Print all nodes that are at distance k from a leaf node
- Print Right View of a Binary Tree
- Construct a tree from Inorder and Level order traversals | Set 1
- Print all nodes at distance k from a given node
- Find if there is a subarray with 0 sum
- Check if a given string is a rotation of a palindrome
- Reverse alternate levels of a perfect binary tree
- Find the maximum path sum between two leaves of a binary tree
- Anagram Substring Search (Or Search for all permutations)
- An Interesting Method to Generate Binary Numbers from 1 to n
- Check if two nodes are cousins in a Binary Tree
- How to efficiently implement k stacks in a single array?
- Find the first repeating element in an array of integers
- Find Height of Binary Tree represented by Parent array
- Length of the largest subarray with contiguous elements | Set 2
- Print nodes between two given level numbers of a binary tree
- Perfect Binary Tree Specific Level Order Traversal
- K'th Smallest/Largest Element in Unsorted Array | Set 1
- How to check if two given sets are disjoint?
- Find the closest leaf in a Binary Tree
- Given a binary string, count number of substrings that start and end with 1.
- Remove nodes on root to leaf paths of length < K
- Find sum of all left leaves in a given Binary Tree
- Check whether a binary tree is a full binary tree or not
- K'th Largest Element in BST when modification to BST is not allowed
- Given a binary tree, how do you remove all the half nodes?
- Online algorithm for checking palindrome in a stream
- Count frequencies of all elements in array in O(1) extra space and O(n) time
- Generate all possible sorted arrays from alternate elements of two given sorted arrays
- Count BST nodes that lie in a given range
- Z algorithm (Linear time pattern searching Algorithm)
- Count distinct elements in every window of size k
- Minimum time required to rot all oranges
- Minimum number of swaps required for arranging pairs adjacent to each other
- Validity of a given Tic-Tac-Toe board configuration
- Longest Consecutive Subsequence
- Transform One String to Another using Minimum Number of Given Operation
- Find maximum of minimum for every window size in a given array
- Print Common Nodes in Two Binary Search Trees
- Length of the longest valid substring
- Find four elements a, b, c and d in an array such that a+b = c+d
- Find the longest path in a matrix with given constraints
- Find three closest elements from given three sorted arrays
- Find Minimum Depth of a Binary Tree
- Construct Binary Tree from given Parent Array representation
- Number of paths with exactly k coins
- Minimum number of bracket reversals needed to make an expression balanced
- Check if a given array can represent Preorder Traversal of Binary Search Tree
- Find the maximum subarray XOR in a given array
- Find Count of Single Valued Subtrees
- Find all possible binary trees with given Inorder Traversal
- Construct a Binary Tree from Postorder and Inorder
- Closest leaf to a given node in Binary Tree
- Check if leaf traversal of two Binary Trees is same?
- Maximum difference between node and its ancestor in Binary Tree
- Lowest Common Ancestor in a Binary Tree | Set 2 (Using Parent Pointer)
- Maximum size rectangle binary sub-matrix with all 1s
- Check if removing an edge can divide a Binary Tree in two halves
- Triangle with no point inside
- Count pairs with given sum
- Vertical Sum in Binary Tree | Set 2 (Space Optimized)
- Perfect Binary Tree Specific Level Order Traversal | Set 2
- Convert a normal BST to Balanced BST
- Convert a given Binary Tree to Doubly Linked List | Set 4
- Return previous element in an expanding matrix
- Find subarray with given sum | Set 2 (Handles Negative Numbers)
- Create a Doubly Linked List from a Ternary Tree
- Check if two trees are Mirror
- Maximum product of a triplet (subsequnece of size 3) in array
- Pair with given product | Set 1 (Find if any pair exists)
- Converting Roman Numerals to Decimal lying between 1 to 3999
- Maximum sum of i*arr[i] among all rotations of a given array
- Find profession in a special family
- Reverse an array in groups of given size
- Direction at last square block
- Maximum element between two nodes of BST
- Convert a Binary Tree to a Circular Doubly Link List
- Binary Indexed Tree : Range Updates and Point Queries
- Flip Binary Tree
- Perfect reversible string
- Convert a Binary Tree to Threaded binary tree | Set 2 (Efficient)
- Count All Palindrome Sub-Strings in a String | Set 1
- Find pairs with given sum such that pair elements lie in different BSTs
- Count pairs whose products exist in array
- Maximum decimal value path in a binary matrix
- Subtree with given sum in a Binary Tree
- Find perimeter of shapes formed with 1s in binary matrix
- Find the closest element in Binary Search Tree
- Check if a string can be obtained by rotating another string 2 places
- Efficient method for 2's complement of a binary string
- Maximum determinant of a matrix with every values either 0 or n
- Find three element from different three arrays such that that a + b + c = sum
- Sum of matrix in which each element is absolute difference of its row and column numbers
- Decimal representation of given binary string is divisible by 5 or not
- Maximum difference between frequency of two elements such that element having greater frequency is also greater
- Sum of matrix element where each elements is integer division of row and column
- Check if there exist two elements in an array whose sum is equal to the sum of rest of the array
- Check if reversing a sub array make the array sorted
- Find all triplets with zero sum
- Minimum operations required to set all elements of binary matrix
- Rearrange an array in maximum minimum form | Set 2 (O(1) extra space)
- Print matrix in antispiral form
- Count passing car pairs
- Sort array after converting elements to their squares
- Maximum and Minimum in a square matrix.
- Given two unsorted arrays, find all pairs whose sum is x
- Search, insert and delete in a sorted array
- Find sum of non-repeating (distinct) elements in an array
- Find the first repeated character in a string
- Noble integers in an array (count of greater elements is equal to value)
- Circular Queue | Set 2 (Circular Linked List Implementation)
- Construct an array from its pair-sum array
- Find maximum (or minimum) in Binary Tree
- Second largest element in BST
- Delete an element from array (Using two traversals and one traversal)
- Program for subtraction of matrices
- Program to print all palindromes in a given range
- Print All Distinct Elements of a given integer array
- Convert left-right representation of a binary tree to down-right
- Stack | Set 2 (Infix to Postfix)
- Stack | Set 4 (Evaluation of Postfix Expression)
- Given level order traversal of a Binary Tree, check if the Tree is a Min-Heap
- Find Excel column number from column title
- Level with maximum number of nodes
- Threaded Binary Tree | Insertion
- Generate all rotations of a given string
- Sort an array after applying the given equation
- Level order traversal line by line | Set 2 (Using Two Queues)
- Count subsets having distinct even numbers
- Determine if a string has all Unique Characters
- Convert Ternary Expression to a Binary Tree
- Program to count vowels in a string (Iterative and Recursive)
- Find distinct elements common to all rows of a matrix
- Length Of Last Word in a String
- Delete consecutive same words in a sequence
- Creating a tree with Left-Child Right-Sibling Representation
- Find Index of 0 to be replaced with 1 to get longest continuous sequence of 1s in a binary array | Set-2
- Count minimum right flips to set all values in an array
- Maximizing Unique Pairs from two arrays
- Leaf nodes from Preorder of a Binary Search Tree
- Program for Point of Intersection of Two Lines
- Decode a string recursively encoded as count followed by substring
- Merge Two Binary Trees by doing Node Sum (Recursive and Iterative)
- Count pairs from two sorted arrays whose sum is equal to a given value x
- Find all pairs (a, b) in an array such that a % b = k
- Magic Square | Even Order
- Break the number into three parts
- Sort a stack using a temporary stack
- Count quadruples from four sorted arrays whose sum is equal to a given value x
- Print common nodes on path from root (or common ancestors)
- Check if binary representations of two numbers are anagram
- Replace each node in binary tree with the sum of its inorder predecessor and successor
- Maximum length substring having all same characters after k changes
- Queue based approach for first non-repeating character in a stream
- Distinct adjacent elements in an array
- Minimum Swaps for Bracket Balancing
- Longest Possible Chunked Palindrome
- Count of occurrences of a "1(0+)1" pattern in a string
- Reverse a number using stack
- Number of turns to reach from one node to other in binary tree
- Print Levels of all nodes in a Binary Tree
- Reversing the first K elements of a Queue
- Find right sibling of a binary tree with parent pointers
- Reversing a Queue
- Evaluate a boolean expression represented as string
- Sum of all nodes in a binary tree
- Find sum of all right leaves in a given Binary Tree
- Sum of all leaf nodes of binary tree
- Smallest element repeated exactly ‘k’ times (not limited to small range)
- Print the nodes at odd levels of a tree
- Count pairs from two BSTs whose sum is equal to a given value x
- Find substrings that contain all vowels
- Maximum area rectangle by picking four sides from array
- Print all palindromic paths from top left to bottom right in a matrix
- Split the array and add the first part to the end
- Sum of all the parent nodes having child node x
- Minimum move to end operations to make all strings equal
- Sort a binary array using one traversal
- Sum of nodes on the longest path from root to leaf node
- Sort string of characters
- Difference between highest and least frequencies in an array
- Find the winner of a game where scores are given as a binary string
- Inorder Successor of a node in Binary Tree
- Count entries equal to x in a special matrix
- Rearrange a binary string as alternate x and y occurrences
- Print next greater number of Q queries
- Maximize the sum of arr[i]*i
- k-th missing element in increasing sequence which is not present in a given sequence
- Divide an array into k segments to maximize maximum of segment minimums
- Length of the longest substring with equal 1s and 0s
- Lexicographically next string
- Minimum cost to sort a matrix of numbers from 0 to n^2 - 1
- Longest subsequence such that difference between adjacents is one | Set 2
- Smallest subarray with k distinct numbers
- Distributing items when a person cannot take more than two items of same type
- Find n-th node of inorder traversal
- Find the first, second and third minimum elements in an array
- Probability of a random pair being the maximum weighted pair
- Program to find the minimum (or maximum) element of an array
- Product of maximum in first array and minimum in second
- Game of replacing array elements
- Find last index of a character in a string
- ZigZag Tree Traversal
- Maximum product of 4 adjacent elements in matrix
- Count subtrees that sum up to a given value x
- Longest subarray with sum divisible by k
- Minimum characters to be replaced to remove the given substring
- Check if array contains contiguous integers with duplicates allowed
- Reverse individual words
- Longest Increasing consecutive subsequence
- Remove the forbidden strings
- Sum of f(a[i], a[j]) over all pairs in an array of n integers
- Maximum difference of zeros and ones in binary string | Set 2 (O(n) time)
- Simple Recursive solution to check whether BST contains dead end
- Interchange elements of first and last rows in matrix
- Priority Queue using Linked List
- Priority Queue using doubly linked list
- Non-Repeating Element
- Sort 1 to N by swapping adjacent elements
- Least frequent element in an array
- Print number in ascending order which contains 1, 2 and 3 in their digits.
- Check given array of size n can represent BST of n levels or not
- Find the only repetitive element between 1 to n-1
- Find sum of all nodes of the given perfect binary tree
- Reverse tree path
- Hypercube Graph
- Maximum Subarray Sum Excluding Certain Elements
- Sum of nodes at maximum depth of a Binary Tree
- Print sorted distinct elements of array
- Count palindrome words in a sentence
- Maximum difference between groups of size two
- Prime String
- Print all funny words in a string
- Number of Digits in a^b
- Odd numbers in N-th row of Pascal's Triangle
- Moser-de Bruijn Sequence
- Possible two sets from first N natural numbers difference of sums as D
- Sort an array which contain 1 to n values
- Find array elements that are greater than average
- Find maximum element of each row in a matrix
- Find largest subtree sum in a tree
- BST to a Tree with sum of all smaller keys
- Check if a number can be expressed as a^b | Set 2
- Word Wrap problem ( Space optimized solution )
- Largest connected component on a grid
- Find postorder traversal of BST from preorder traversal
- Count elements present in first array but not in second
- Count pairs with Bitwise AND as ODD number
- Longest common anagram subsequence from N strings
- Number of Co-prime pairs obtained from the sum of digits of elements in the given range
- Sum of all elements repeating 'k' times in an array
- Split the array and add the first part to the end | Set 2
- Print direction of moves such that you stay within the [-k, +k] boundary
- Length of longest consecutive zeroes in the binary representation of a number.
- Majority element in a circular array of 0's and 1's
- Value in a given range with maximum XOR
- Find Nth term of series 1, 4, 15, 72, 420...
- Check if an array is sorted and rotated
- Program to find the Nth term of series 0, 4, 14, 30, 51, 80, 114, 154, 200, ...
- Program to find the Nth term of the series 0, 14, 40, 78, 124, ...
- Count ways to reach a score using 1 and 2 with no consecutive 2s
- Area of squares formed by joining mid points repeatedly
- Check if a point is inside, outside or on the parabola
- Program to print the series 2, 1, 4, 3, 6, 5, .... up to N terms
- Check if a number is a Pythagorean Prime or not
- Sum of numbers from 1 to N which are divisible by 3 or 4
- Length of the longest Subarray with only Even Elements
- Number of special pairs possible from the given two numbers
- Find nth Term of the Series 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 ...
- Check if a number is Primorial Prime or not
- Check if a string is the typed name of the given name
- Check whether a binary string can be formed by concatenating given N numbers sequentially
- Rotate the sub-list of a linked list from position M to N to the right by K places
- K- Fibonacci series
- Check whether the vowels in a string are in alphabetical order or not
- Largest number divisible by 90 that can be made using 0 and 5
- Minimum swaps required to make a binary string alternating
- Count changes in Led Lights to display digits one by one
- Check whether bitwise OR of N numbers is Even or Odd
- Program to find Nth term divisible by a or b
- Minimum boxes required to carry all gifts
- Assign other value to a variable from two possible values
- Find amount to be added to achieve target ratio in a given mixture
- Find time taken for signal to reach all positions in a string
- Treasure and Cities
- Minimize Cost with Replacement with other allowed
- Minimum number of operations required to delete all elements of the array
- Check whether product of digits at even places of a number is divisible by K
- Replace every array element by Bitwise Xor of previous and next element
- Longest subarray with elements having equal modulo K
- GCD of a number raised to some power and another number
- Smallest subarray such that all elements are greater than K
- Position after taking N steps to the right and left in an alternate manner
- Find the count of substrings in alphabetic order
- Change K elements so that (a1^2 + a2^2 + …+ aN^2 ) <= (a1 + a2 +…+ aN) becomes true
- Fibonacci problem (Value of Fib(N)*Fib(N) - Fib(N-1) * Fib(N+1))
- Sum of first N natural numbers which are not powers of K
- Check if a prime number can be expressed as sum of two Prime Numbers
- Find the other number when LCM and HCF given
- Sum of the elements from index L to R in an array when arr[i] = i * (-1)^i
- Count of cyclic permutations having XOR with other binary string as 0
- Sum of all natural numbers in range L to R
- Sum of all odd natural numbers in range L and R
- Count Numbers with N digits which consists of even number of 0’s
- Find determinant of matrix generated by array rotation
- Minimum elements to change so that for an index i all elements on the left are -ve and all elements on the right are +ve
- Program to find first N Iccanobif Numbers
- Maximize the difference between two subsets of a set with negatives
- Program to print Step Pattern
- Filling diagonal to make the sum of every row, column and diagonal equal of 3x3 matrix
- Minimum value to be added to X such that it is at least Y percent of N
- XOR of XORs of all sub-matrices
- Print the lexicographically smallest DFS of the graph starting from 1
- Count the Number of Binary Search Trees present in a Binary Tree
- Count of all even numbers in the range [L, R] whose sum of digits is divisible by 3
- Replace every consonant sequence with its length in the given string
- Check if product of digits of a number at even and odd places is equal
- Minimum cost to make a string free of a subsequence
- Find smallest number K such that K % p = 0 and q % K = 0
- Probability of A winning the match when individual probabilities of hitting the target given
- Print n numbers such that their sum is a perfect square
- Sum of all odd factors of numbers in the range [l, r]
- Check if a number can be represented as sum of non zero powers of 2
- Find kth smallest number in range [1, n] when all the odd numbers are deleted
- Find Nth term of the series 1, 6, 18, 40, 75, ....
- Find Nth term of the series 1, 5, 32, 288 ...
- Count numbers which are divisible by all the numbers from 2 to 10
- Find last five digits of a given five digit number raised to power five
- Ways to place 4 items in n^2 positions such that no row/column contains more than one
- Find the count of numbers that can be formed using digits 3, 4 only and having length at max N.
- Number of ways to pair people
- Maximum Primes whose sum is equal to given N
- Third last digit in 5^N for given N
- Sum of the series 1^1 + 2^2 + 3^3 + ..... + n^n using recursion
- Sum of all i such that (2^i + 1) % 3 = 0 where i is in range [1, n]
- Sum of all even factors of numbers in the range [l, r]
- Count numbers having N 0's and and M 1's with no leading zeros
- Maximum average of a subarray of size of atleast X and atmost Y
- Find the total guests that are present at the party
- Count rotations of N which are Odd and Even
- Count of pairs from 1 to a and 1 to b whose sum is divisible by N
- Check if the given array can be reduced to zeros with the given operation performed given number of times
- Largest sphere that can be inscribed within a cube which is in turn inscribed within a right circular cone
- Create a mirror tree from the given binary tree
- Find amount of water wasted after filling the tank
- Given count of digits 1, 2, 3, 4, find the maximum sum possible
- Print last character of each word in a string
- Print all leaf nodes of a binary tree from right to left
- Count distinct points visited on the number line
- Check whether the sum of element of a node is equal to the given key value
- Elements greater than the previous and next element in an Array