- Count of strings that can be formed from another string using each character at-most once
- Initialize an ArrayList in Java
- Finding n-th term of series 3, 13, 42, 108, 235…
- Find n-th term of series 1, 4, 27, 16, 125, 36, 343 .......
- Delete all Prime Nodes from a Singly Linked List
- Implement a stack using singly linked list
- Delete all the even nodes from a Doubly Linked List
- Probability of rain on N+1th day
- Probability of a key K present in array
- Count pairs with Bitwise OR as Even number
- Count pairs with Bitwise AND as ODD number
- Count pairs with Bitwise XOR as ODD number
- Check if a key is present in every segment of size k in an array
- Delete array element in given index range [L - R]
- How to randomly select rows from Pandas DataFrame
- Find Nth term of the series 0, 2, 4, 8, 12, 18...
- Find Nth term of the series 5, 13, 25, 41, 61...
- Find Nth term of the series 3, 14, 39, 84...
- Find Nth term of the series 1, 8, 54, 384...
- Find Nth term of the series 1, 1, 2, 6, 24...
- Difference Between LinkedList and LinkedHashSet in Java
- Replace every element of the array by sum of all other elements
- Product of all prime nodes in a Doubly Linked List
- Convert a String to Integer Array in C/C++
- Sum of the nodes of a Singly Linked List
- Find count of common nodes in two Doubly Linked Lists
- Balance a string after removing extra brackets
- Delete all the nodes from the list which are less than K
- Convert List of Characters to String in Java
- Find other two sides and angles of a right angle triangle
- Delete linked list nodes which have a greater value on left side
- Delete all the nodes from a doubly linked list that are smaller than a given value
- Sum of all nodes in a doubly linked list divisible by a given number K
- Code valid in both C and C++ but produce different output
- Program to Convert List to Map in Java
- Delete all the nodes from the list which are divisible by any given number K
- Replace even nodes of a doubly linked list with the elements of array
- Delete linked list nodes which have a Lesser Value on Left Side
- Maximum element in min heap
- Sum of the nodes of a Circular Linked List
- Delete all the even nodes of a Circular Linked List
- Print all even nodes of Binary Search Tree
- Delete all Prime Nodes from a Circular Singly Linked List
- Print Sum and Product of all Non-Leaf nodes in Binary Tree
- Find normal at a given point on the curve
- Find first and last element of ArrayList in java
- Remove all elements from the ArrayList in Java
- Remove repeated elements from ArrayList in Java
- Find Tangent at a given point on the curve
- Convert String to Double in Java
- Program to Convert a Vector to List in Java
- Min and Max in a List in Java
- Convert Double to Integer in Java
- Find common elements in two ArrayLists in Java
- Convert an ArrayList of String to a String array in Java
- Difference between HashMap and HashSetv
- Find two non-overlapping pairs having equal sum in an Array
- Difference between length of Array and size of ArrayList in Java
- Print all nodes between two given levels in Binary Tree
- Method within method in java
- Split a list into two halves in Java
- Get name of current method being executed in Java
- How do Dynamic arrays work?
- Differences between wait() and join() methods in Java
- Count number of a class objects created in Java
- Get first and last elements from ArrayList in Java
- Difference between ArrayList and HashSet in Java
- What is the difference between field, variable, attribute, and property in Java
- LinkedHashMap and LinkedHashSet in Java
- Calculate volume and surface area of Torus
- Format Specifiers in Java
- Remove all occurrences of an element from Array in Java
- Future and FutureTask in java
- Find minimum and maximum elements in singly Circular Linked List
- BlockingQueue Interface in Java
- Difference Between Daemon Threads and User Threads In Java
- Deletion at different positions in a Circular Linked List
- Delete all odd or even positioned nodes from Circular Linked List
- Array implementation of queue (Simple)
- Sum and Product of the nodes of a Circular Singly Linked List which are divisible by K
- Difference between a Static Queue and a Singly Linked List
- Generate random String of given size in Java
- Print all pairs in an unsorted array with equal sum
- ArrayList vs. HashMap in Java
- How to select multiple columns in a pandas dataframe
- Non-generic Vs Generic Collection in Java
- DelayQueue class in Java with Example
- Different ways to sort an array in descending order in C#
- Randomly select items from a List in Java
- Find smallest and largest element from square matrix diagonals
- Reset Index in Pandas Dataframe
- Blocks in PL/SQL
- Get unique values from a column in Pandas DataFrame
- How to drop one or multiple columns in Pandas Dataframe
- valarray atan2() function in C++
- Difference and similarities between HashSet, LinkedHashSet and TreeSet in Java
- Maximum sum of cocktail glass in a 2D matrix
- Queries to find the first non-repeating character in the sub-string of a string
- Puzzle | Divide a Square into 5 parts such that 4 parts among them are equal
- Check whether array has all identical elements using Arrays.asList() and HashSet in Java
- Program to calculate the area of Kite

- Remove duplicates from a given string
- Write a program to reverse digits of a number
- Program for n'th node from the end of a Linked List
- Write a function to delete a Linked List
- Reverse a linked list
- Function to check if a singly linked list is palindrome
- k largest(or smallest) elements in an array | added Min Heap method
- Compute the integer absolute value (abs) without branching
- Block swap algorithm for array rotation
- Print reverse of a Linked List without actually reversing
- Count Inversions in an array | Set 1 (Using Merge Sort)
- Maximum and minimum of an array using minimum number of comparisons
- Find whether a given number is a power of 4 or not
- Maximum width of a binary tree
- Identical Linked Lists
- Find the two repeating elements in a given array
- Evaluation order of operands
- Find duplicates in O(n) time and O(1) extra space | Set 1
- Detect and Remove Loop in a Linked List
- Check if a binary tree is subtree of another binary tree | Set 1
- Add two numbers represented by linked lists | Set 1
- Delete a given node in Linked List under given constraints
- Sorted Linked List to Balanced BST
- Check whether two strings are anagram of each other
- Interleaving of two given strings with no common characters
- Pattern Searching | Set 6 (Efficient Construction of Finite Automata)
- Hamiltonian Cycle | Backtracking-6
- Longest Palindromic Subsequence | DP-12
- Find a triplet from three linked lists with sum equal to a given number
- Count the number of possible triangles
- Find a pair with given sum in a Balanced BST
- Minimum insertions to form a palindrome | DP-28
- Longest Common Substring | DP-29
- Delete N nodes after M nodes of a linked list
- Find maximum number of edge disjoint paths between two vertices
- Print all possible paths from top left to bottom right of a mXn matrix
- Pairwise swap elements of a given linked list by changing links
- Find if two rectangles overlap
- Check if a given Binary Tree is height balanced like a Red-Black Tree
- Remove minimum elements from either side such that 2*min becomes more than max
- Program for nth Catalan Number
- Check if a given string is a rotation of a palindrome
- Channel Assignment Problem
- Check if a binary tree is subtree of another binary tree | Set 2
- Print squares of first n natural numbers without using *, / and -
- Print all elements in sorted order from row and column wise sorted matrix
- Multiply two polynomials
- How to check if two given sets are disjoint?
- K'th Smallest/Largest Element in Unsorted Array | Set 3 (Worst Case Linear Time)
- Given a linked list of line segments, remove middle points
- Longest Even Length Substring such that Sum of First and Second Half is same
- Print all paths from a given source to a destination
- Greedy Algorithm for Egyptian Fraction
- Find a common element in all rows of a given row-wise sorted matrix
- Check whether a binary tree is a complete tree or not | Set 2 (Recursive Solution)
- Function to find Number of customers who could not get a computer
- Group multiple occurrence of array elements ordered by first occurrence
- Iterative Merge Sort
- Compute n! under modulo p
- Converting Decimal Number lying between 1 to 3999 to Roman Numerals
- Remove spaces from a given string
- Compute sum of digits in all numbers from 1 to n
- Count BST subtrees that lie in given range
- Converting a Real Number (between 0 and 1) to Binary String
- Find sum of all elements in a matrix except the elements in row and/or column of given cell?
- Count distinct elements in every window of size k
- Collect maximum points in a grid using two traversals
- Maximum Path Sum in a Binary Tree
- Count total number of N digit numbers such that the difference between sum of even and odd digits is 1
- Print string of odd length in 'X' format
- Lazy Propagation in Segment Tree
- Find minimum possible size of array with given rules for removing elements
- Count number of ways to partition a set into k subsets
- Compare two strings represented as linked lists
- Range Minimum Query (Square Root Decomposition and Sparse Table)
- Print cousins of a given node in Binary Tree
- Number of paths with exactly k coins
- Combinatorial Game Theory | Set 3 (Grundy Numbers/Nimbers and Mex)
- Check if a given number is Fancy
- Clone a linked list with next and random pointer in O(1) space
- Search a Word in a 2D Grid of characters
- Find the smallest twins in given range
- Count number of ways to divide a number in 4 parts
- Print individual digits as words without using if or switch
- Euler's criterion (Check if square root under modulo p exists)
- Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)
- G-Fact 19 (Logical and Bitwise Not Operators on Boolean)
- Rearrange an array in maximum minimum form | Set 1
- Form minimum number from given sequence
- How to avoid overflow in modular multiplication?
- 1's and 2's complement of a Binary Number
- Number of Integral Points between Two Points
- Print leftmost and rightmost nodes of a Binary Tree
- Add 1 to a number represented as linked list
- Comparator Interface in Java with Examples
- Print root to leaf paths without using recursion
- Disjoint Set Data Structures
- Common elements in all rows of a given matrix
- Maximum product of a triplet (subsequnece of size 3) in array
- Find smallest range containing elements from k lists
- Find if string is K-Palindrome or not | Set 1
- Decimal Equivalent of Binary Linked List
- Counting Triangles in a Rectangular space using BIT
- Wildcard Pattern Matching
- Smallest Subarray with given GCD
- Number of ways to calculate a target number using only array elements
- Rearrange a string so that all same characters become atleast d distance away
- How to find Lexicographically previous permutation?
- Longest Common Prefix using Character by Character Matching
- Lower case to upper case - An interesting fact
- Longest Common Prefix using Trie
- Implement a stack using single queue
- Palindrome Substring Queries
- Find if string is K-Palindrome or not | Set 2
- Print extreme nodes of each level of Binary Tree in alternate order
- Jolly Jumper Sequence
- Find all triplets in a sorted array that forms Geometric Progression
- Check if string follows order of characters defined by a pattern or not | Set 1
- Reverse an array in groups of given size | Set 2 (Variations of Set 1 )
- Find if an expression has duplicate parenthesis or not
- A Space Optimized DP solution for 0-1 Knapsack Problem
- Find Two Missing Numbers | Set 1 (An Interesting Linear Time Solution)
- Maximize value of (arr[i] - i) - (arr[j] - j) in an array
- Longest repeating and non-overlapping substring
- Pairs of complete strings in two sets of strings
- Frequency Measuring Techniques for Competitive Programming
- Maximum and Minimum Product Subsets
- Connect Nodes at same Level (Level Order Traversal)
- Queries in a Matrix
- Count all pairs with given XOR
- Swap Nodes in Binary tree of every k'th level
- Count of distinct substrings of a string using Suffix Trie
- Check if there is a root to leaf path with given sequence
- Aliquot Sequence
- Sum of maximum elements of all subsets
- Count characters at same position as in English alphabet
- Maximum subsequence sum such that no three are consecutive
- Print matrix in diagonal pattern
- Maximum decimal value path in a binary matrix
- Minimum cost to sort strings using reversal operations of different costs
- Sort even-placed elements in increasing and odd-placed in decreasing order
- Find the first natural number whose factorial is divisible by x
- Program to implement Collatz Conjecture
- Count natural numbers whose all permutation are greater than that number
- Sublist Search (Search a linked list in another list)
- Rearrange an array to minimize sum of product of consecutive pair elements
- Find pair with greatest product in array
- Find a partition point in array
- Find pairs in array whose sums already exist in array
- K-th smallest element after removing some integers from natural numbers
- Queries on substring palindrome formation
- Convert a tree to forest of even nodes
- Primitive root of a prime number n modulo n
- Sum of matrix in which each element is absolute difference of its row and column numbers
- Friends Pairing Problem
- Minimum steps to reach target by a Knight | Set 1
- Count binary strings with k times appearing adjacent two set bits
- Implementation of Affine Cipher
- Program for FCFS CPU Scheduling | Set 1
- 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
- Maximize sum of N X N upper left sub-matrix from given 2N X 2N matrix
- Find all triplets with zero sum
- Print a matrix in alternate manner (left to right then right to left)
- Circular Singly Linked List | Insertion
- Largest subsequence having GCD greater than 1
- Number with maximum number of prime factors
- Find length of the largest region in Boolean Matrix
- Count all pairs of an array which differ in K bits
- Find N'th item in a set formed by sum of two arrays
- Ways to represent a number as a sum of 1's and 2's
- Palindrome pair in an array of words (or strings)
- Make largest palindrome by changing at most K-digits
- Find largest word in dictionary by deleting some characters of given string
- Number Theory | Generators of finite cyclic group under addition
- Find longest sequence of 1's in binary representation with one flip
- Character replacement after removing duplicates from a string
- Lexicographically first palindromic string
- Minimum swaps to reach permuted array with at most 2 positions left swaps allowed
- Point Clipping Algorithm in Computer Graphics
- Convert decimal fraction to binary number
- Search, insert and delete in an unsorted array
- Search, insert and delete in a sorted array
- Find sum of non-repeating (distinct) elements in an array
- Recaman's sequence
- Number of substrings divisible by 6 in a string of integers
- Iterative program to count leaf nodes in a Binary Tree
- Count half nodes in a Binary tree (Iterative and Recursive)
- Noble integers in an array (count of greater elements is equal to value)
- Find Duplicates of array using bit array
- Largest subset of Graph vertices with edges of 2 or more colors
- Multiply large integers under large modulo
- Change a Binary Tree so that every node stores sum of all nodes in left subtree
- Banker's Algorithm in Operating System
- Check if characters of a given string can be rearranged to form a palindrome
- Lexicographically minimum string rotation | Set 1
- Find the largest three elements in an array
- Triangular Numbers
- Program to print Sum Triangle for a given array
- Check if two numbers are equal without using arithmetic and comparison operators
- Iterative Search for a key 'x' in Binary Tree
- Linked List | Set 2 (Inserting a node)
- Queue - Linked List Implementation
- Search an element in a Linked List (Iterative and Recursive)
- Insertion Sort for Singly Linked List
- Delete last occurrence of an item from linked list
- Stack | Set 3 (Reverse a string using stack)
- Minimum number of Appends needed to make a string palindrome
- Move spaces to front of string in single traversal
- Binary representation of next number
- Maximum sum two non-overlapping subarrays of given size
- Sort an array of strings according to string lengths
- Binary representation of next greater number with same number of 1's and 0's
- Remove all occurrences of duplicates from a sorted Linked List
- Count the number of ways to divide an array into three contiguous parts having equal sum
- k-th distinct (or non-repeating) element in an array.
- Count number of ways to jump to reach end
- Reverse an array without using subtract sign ‘-‘ anywhere in the code
- First element occurring k times in an array
- Partitioning a linked list around a given value and If we don't care about making the elements of the list "stable"
- Count subsets having distinct even numbers
- Smallest window that contains all characters of string itself
- Shortest Uncommon Subsequence
- Program to find Smallest and Largest Word in a String
- Program to remove vowels from a String
- Dynamic Connectivity | Set 1 (Incremental)
- Convert a given Binary tree to a tree that holds Logical AND property
- Sum of divisors of factorial of a number
- Check whether a given binary tree is perfect or not
- Check if a given string is a valid number (Integer or Floating Point) | SET 1(Basic approach)
- Find Index of 0 to be replaced with 1 to get longest continuous sequence of 1s in a binary array | Set-2
- Find uncommon characters of the two strings
- String containing first letter of every word in a given string with spaces
- URLify a given string (Replace spaces is %20)
- Maximizing Unique Pairs from two arrays
- Print all substring of a number without any conversion
- Reverse vowels in a given string
- Program for quotient and remainder of big number
- Count pairs from two sorted arrays whose sum is equal to a given value x
- Painting Fence Algorithm
- Find Corners of Rectangle using mid points
- Print all internal nodes of a Binary tree
- Check if a string is Isogram or not
- Check if absolute difference of consecutive nodes is 1 in Linked List
- Check if an array represents Inorder of Binary Search tree or not
- Find the sum of last n nodes of the given Linked List
- Find two numbers from their sum and XOR
- Maximize matrix as per given condition
- Subarray Inversions
- Count quadruples from four sorted arrays whose sum is equal to a given value x
- Find k-th bit in a binary string created by repeated invert and append operations
- Check if binary representations of two numbers are anagram
- Lexicographically n-th permutation of a string
- Master Theorem For Subtract and Conquer Recurrences
- Count words that appear exactly two times in an array of words
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Find length of loop in linked list
- Convert all substrings of length 'k' from base 'b' to decimal
- Find a string such that every character is lexicographically greater than its immediate next character
- Check if the given string of words can be formed from words present in the dictionary
- Check if binary representation of a given number and its complement are anagram
- Reverse a Linked List according to its Size
- Construct a complete binary tree from given array in level order fashion
- Longest Prime Subarray after removing one element
- Find any one of the multiple repeating elements in read only array
- Minimum Index Sum for Common Elements of Two Lists
- Merging two unsorted arrays in sorted order
- Counts Path in an Array
- Longest common substring in binary representation of two numbers
- Find the fractional (or n/k - th) node in linked list
- Largest number with the given set of N digits that is divisible by 2, 3 and 5
- Find modular node in a linked list
- Minimize cost of operation to equalize tower heights
- Shortest distance between two nodes in BST
- An interesting solution to get all prime numbers smaller than n
- Given two strings check which string makes a palindrome first
- Smallest element in an array that is repeated exactly 'k' times.
- A modified game of Nim
- Count All Palindrome Sub-Strings in a String | Set 2
- Count subarrays with equal number of occurrences of two given elements
- Insertion in a Binary Tree in level order
- Longest Common Substring in an Array of Strings
- Insert node into the middle of the linked list
- Smallest element repeated exactly ‘k’ times (not limited to small range)
- Length of the smallest sub-string consisting of maximum distinct characters
- Remove three consecutive duplicates from string
- Interleave the first half of the queue with second half
- Find the n-th number whose binary representation is a palindrome
- Find if a 2-D array is completely traversed or not by following the cell values
- Diameter of a Binary Tree in O(n) [A new method]
- Longest subsequence where every character appears at-least k times
- Count pairs in an array such that LCM(arr[i], arr[j]) > min(arr[i],arr[j])
- Program for SSTF disk scheduling algorithm
- Binary representation of previous number
- Program for Next Fit algorithm in Memory Management
- A sorting algorithm that slightly improves on selection sort
- Count number of digits after decimal on dividing a number
- Maximum number of edges to be added to a tree so that it stays a Bipartite graph
- Count unset bits of a number
- Array range queries over range queries
- DFS for a n-ary tree (acyclic graph) represented as adjacency list
- Maximize the binary matrix by filpping submatrix once
- Smallest number k such that the product of digits of k is equal to n
- Make middle node head in a linked list
- Sort string of characters
- Construct BST from its given level order traversal
- Unique element in an array where all elements occur k times except one
- Count of alphabets having ASCII value less than and greater than k
- Largest number with one swap allowed
- Check if a string is suffix of another
- Sudo Placement[1.4] | BST Traversal
- Happy Numbers
- Sort a Rotated Sorted Array
- Unique cells in a binary matrix
- Lexicographically largest subsequence such that every character occurs at least k times
- Combinations in a String of Digits
- Maximize value of (a[i]+i)*(a[j]+j) in an array
- Replace node with depth in a binary tree
- Generate permutations with only adjacent swaps allowed
- Common characters in n strings
- Simplify the directory path (Unix like)
- Check if the given array can represent Level Order Traversal of Binary Search Tree
- Minimum sum by choosing minimum of pairs from array
- Longest subarray having count of 1s one more than count of 0s
- Reverse a circular linked list
- Program to sort string in descending order
- Lexicographically smallest permutation with distinct elements using minimum replacements
- Smallest root of the equation x^2 + s(x)*x - n = 0, where s(x) is the sum of digits of root x.
- Distinct permutations of the string | Set 2
- Minimum number of elements to add to make median equals x
- Average numbers in array
- Count all 0s which are blocked by 1s in binary matrix
- Remove all characters other than alphabets from string
- Longest subarray not having more than K distinct elements
- Encoding a word into Pig Latin
- Divisors of n-square that are not divisors of n
- Largest number less than or equal to N in BST (Iterative Approach)
- Find if there is a rectangle in binary matrix with corners as 1
- Sort an array with swapping only with a special element is allowed
- Sorting using trivial hash function
- Maximum consecutive numbers present in an array
- Pair with given sum and maximum shortest distance from end
- Count sub-arrays which have elements less than or equal to X
- Maximum and Minimum value of a quadratic function
- Mirror of matrix across diagonal
- Count of operations to make a binary string"ab" free
- Find index of closing bracket for a given opening bracket in an expression
- Generate original array from an array that store the counts of greater elements on right
- Next word that does not contain a palindrome and has characters from first k
- Construct lexicographically smallest palindrome
- Print Longest Palindromic Subsequence
- Unset the last m bits
- Length of longest strict bitonic subsequence
- Decimal to octal conversion with minimum use of arithmetic operators
- Minimum cost to construct a string
- Queries for maximum difference between prime numbers in given ranges
- Binary Tree (Array implementation)
- Find largest element from array without using conditional operator
- Largest divisible pairs subset
- Minimum cost to make Longest Common Subsequence of length k
- DFS traversal of a tree using recursion
- Modify and Rearrange List
- Form the largest palindromic number using atmost two swaps
- Count subarrays with equal number of 1's and 0's
- Minimum number of subsets with distinct elements
- Print first N Mosaic numbers
- Program for triangular patterns of alphabets
- Print Reverse a linked list using Stack
- Check if the given string is the same as its reflection in a mirror
- Minimum difference between groups of size two
- Minimum Cost to make two Numeric Strings Identical
- Insert a whole linked list into other at k-th position
- Find next right node of a given key | Set 2
- Palindromic Selfie Numbers
- Find the Kth smallest element in the sorted generated array
- Vertical width of Binary tree | Set 1
- Rank of all elements in an array
- Banker's Algorithm in Operating System
- Median and Mode using Counting Sort
- Make a loop at k-th position in a linked list
- Delete a linked list using recursion
- Find the one missing number in range
- Height of binary tree considering even level leaves only
- Check if both halves of the string have at least one different character
- Covert string X to an anagram of string Y with minimum replacements
- Find the largest node in Doubly linked list
- Reduce Hamming distance by swapping two characters
- Partitioning into two contiguous element subarrays with equal sums
- Count consonants in a string (Iterative and recursive methods)
- Program to find simple moving average
- Connell Sequence
- String from prefix and suffix of given two strings
- Tilt of Binary Tree
- Maximum distinct lowercase alphabets between two uppercase
- Height of a generic tree from parent array
- Linked List Pair Sum
- Alternate Odd and Even Nodes in a Singly Linked List
- Expression contains redundant bracket or not
- Maximum spiral sum in Binary Tree
- Leaf nodes from Preorder of a Binary Search Tree (Using Recursion)
- Consecutive sequenced numbers in a string
- Total numbers with no repeated digits in a range
- N Queen in O(n) space
- Remove all outgoing edges except edge with minimum weight
- Substrings starting with vowel and ending with consonants and vice versa
- Non-Repeating Element
- Insertion sort to sort even and odd positioned elements in different orders
- Program to copy the contents of one array into another in the reverse order
- Sum of products of all combination taken (1 to n) at a time
- Sorted merge in one array
- Maximum occurring character in a linked list
- Iterative HeapSort
- Program to check if matrix is singular or not
- Check given array of size n can represent BST of n levels or not
- Find middle of singly linked list Recursively
- Count ordered pairs of positive numbers such that their sum is S and XOR is K
- Reverse each word in a linked list node
- Find the only repetitive element between 1 to n-1
- Power Set in Lexicographic order
- Function to copy string (Iterative and Recursive)
- Sort an array containing two types of elements
- Check if two strings are permutation of each other
- Schedule jobs so that each server gets equal load
- Find one extra character in a string
- Smallest multiple of a given number made of digits 0 and 9 only
- Check if item can be measured using a scale and some weights
- Lexicographically next greater string using same character set
- Array range queries for elements with frequency same as value
- Count substrings with each character occurring at most k times
- Generate a list of n consecutive composite numbers (An interesting method)
- Longest common suffix of two linked lists
- Disjoint Set Union on trees | Set 1
- Find unique elements in linked list
- Reverse Morris traversal using Threaded Binary Tree
- Ways to split string such that each partition starts with distinct character
- Check if it possible to partition in k subarrays with equal sum
- Check if linked list is sorted (Iterative and Recursive)
- Number of common base strings for two strings
- Find the Largest Cube formed by Deleting minimum Digits from a number
- Dynamic Programming | Wildcard Pattern Matching | Linear Time and Constant Space
- Find nth term of the Dragon Curve Sequence
- Hill Cipher
- Find maximum element of each row in a matrix
- Maximum product subset of an array
- Arithmetic Number
- Position of n among the numbers made of 2, 3, 5 & 7
- Program to display all alphabets from A to Z in uppercase and lowercase both
- Longest substring having K distinct vowels
- Maximum average sum partition of an array
- Find Sum of all unique sub-array sum for a given array.
- Number of ways to merge two arrays such retaining order
- Print reverse string after removing vowels
- Program to reverse a string (Iterative and Recursive)
- Count number of pairs in array having sum divisible by K | SET 2
- Check for balanced parentheses in an expression | O(1) space
- Minimum bit changes in Binary Circular array to reach a index
- Maximum adjacent difference in an array in its sorted form
- Maximum length of a sub-array with ugly numbers
- Count pairs with set bits sum equal to K
- Reverse String according to the number of words
- Maximum product quadruple (sub-sequence of size 4) in array
- Add n binary strings
- Subtract 1 without arithmetic operators
- Check whether the number formed by concatenating two numbers is a perfect square or not
- Longest subarray such that adjacent elements have at least one common digit | Set 1
- Print concentric rectangular pattern in a 2d matrix
- Design a stack to retrieve original elements and return the minimum element in O(1) time and O(1) space
- Multiset Equivalence Problem
- Smallest number in BST which is greater than or equal to N
- Sort the biotonic doubly linked list | Set-2
- Find n-th node in Preorder traversal of a Binary Tree
- Find a Symmetric matrix of order N that contain integers from 0 to N-1 and main diagonal should contain only 0's
- Find the closest element in Binary Search Tree | Space Efficient Method
- Find the number of operations required to make all array elements Equal
- Convert a Binary Tree such that every node stores the sum of all nodes in its right subtree
- Recursive program to generate power set
- Repeated Character Whose First Appearance is Leftmost
- Print all triplets with given sum
- Print all distinct circular strings of length M in lexicographical order
- Number of permutations such that sum of elements at odd index and even index are equal
- Degree of a Cycle Graph
- Minimum inverting factor in an array
- Rearrange a Linked List in Zig-Zag fashion | Set-2
- Minimum steps needed to cover a sequence of points on an infinite grid
- Make all numbers of an array equal
- Remove leading zeros from an array
- Remove edges connected to a node such that the three given nodes are in different trees
- Number of Larger Elements on right side in a string
- Print cousins of a given node in Binary Tree | Single Traversal
- Permutation of a string with maximum number of characters greater than its adjacent characters
- Reduce string to shortest length by deleting a pair of same adjacent characters
- Minimum element left from the array after performing given operations
- Replace every element with the greatest element on its left side
- Level order traversal in spiral form | Using one stack and one queue
- Check if concatenation of two strings is balanced or not
- Lexicographically smallest string formed by appending a character from the first K characters of a given string
- Sudo Placement[1.3] | Stack Design
- Number of Counterclockwise shifts to make a string palindrome
- Delete all the nodes from the doubly linked list that are greater than a given value
- First non-repeating character using one traversal of string | Set 2
- Print the nearest prime number formed by adding prime numbers to N
- Sum of all maximum frequency elements in Matrix
- Replace every character of string by character whose ASCII value is K times more than it
- Find index of first occurrence when an unsorted array is sorted
- Sudo Placement[1.5] | Wolfish
- Sorting without comparison of elements
- Sum of all prime divisors of all the numbers in range L-R
- Number of elements smaller than root using preorder traversal of a BST
- Shortest distance between two nodes in an infinite binary tree
- Find indices of all occurrence of one string in other
- Check if two trees have same structure
- Possible number of Rectangle and Squares with the given set of elements
- Count pairs with Bitwise XOR as ODD number
- Saddleback Search Algorithm in a 2D array
- Majority Element | Set-2 (Hashing)
- Flatten a binary tree into linked list | Set-2
- Delete array element in given index range [L - R]
- Round Robin Scheduling with different arrival times
- Number of integral solutions for equation x = b*(sumofdigits(x)^a)+c
- Sum of all elements repeating 'k' times in an array
- Total sum except adjacent of a given node in a Binary Tree
- Counting frequencies of array elements
- Bubble Sort On Doubly Linked List
- Split array to three subarrays such that sum of first and third subarray is equal and maximum
- Difference between fundamental data types and derived data types
- Minimum multiplications with {2, 3, 7} to make two numbers equal
- Prim's Algorithm (Simple Implementation for Adjacency Matrix Representation)
- Kruskal's Algorithm (Simple Implementation for Adjacency Matrix)
- Minimum number of changes required to make the given array an AP
- Printing frequency of each character just after its consecutive occurrences
- Balanced expressions such that given positions have opening brackets | Set 2
- Minimum element in a max heap
- Check if Queue Elements are pairwise consecutive
- Modulo power for large numbers represented as strings
- Program to find GCD or HCF of two numbers using Middle School Procedure
- Check if the first and last digit of the smallest number forms a prime
- Sort first k values in ascending order and remaining n-k values in descending order
- Find kth node from Middle towards Head of a Linked List
- Convert an Array to a Circular Doubly Linked List
- Find Nth term of series 1, 4, 15, 72, 420...
- Recursive Approach to find nth node from the end in the linked list
- Longest subarray having maximum sum
- Reverse a doubly circular linked list
- Find the largest after deleting the given elements
- LIFO (Last-In-First-Out) approach in Programming
- Remove duplicates from a string in O(1) extra space
- Sum of the nodes of a Singly Linked List
- Check if a number is divisible by 41 or not
- Find count of common nodes in two Doubly Linked Lists
- Count elements that are divisible by at-least one element in another array
- Rat in a Maze | Backtracking using Stack
- Find four factors of N with maximum product and sum equal to N
- Minimum operation require to make first and last character same
- Find Nth term (A matrix exponentiation example)
- Generating subarrays using recursion
- Recursively Reversing a linked list (A simple implementation)
- Maximize the product of four factors of a Number
- Find a palindromic string B such that given String A is a subsequense of B
- Check if given string can be formed by two other strings or their permutations
- Find any pair with given GCD and LCM
- Minimum number of palindromes required to express N as a sum | Set 2
- Count the number of ways to traverse a Matrix
- Count numbers (smaller than or equal to N) with given digit sum
- Delete all the nodes from a doubly linked list that are smaller than a given value
- Sum of minimum elements of all subarrays
- Program to check if all characters have even frequency
- Maximum and Minimum element of a linked list which is divisible by a given number k
- Find the winner of the Game to Win by erasing any two consecutive similar alphabets
- Find number of magical pairs of string of length L
- Find triplets in an array whose AND is maximum
- Check if Queue Elements are pairwise consecutive | Set-2
- Remove a given word from a String
- Ways to write N as sum of two or more positive integers | Set-2
- Replace even nodes of a doubly linked list with the elements of array
- Print Doubly Linked list in Reverse Order
- Check if a Linked List is Pairwise Sorted
- Delete all Prime Nodes from a Doubly Linked List
- Delete all nodes from the doubly linked list which are divisible by K
- Check if elements of Linked List are present in pair
- Number of balanced bracket subsequence of length 2 and 4
- Replace minimal number of characters to make all characters pair wise distinct
- Quotient - Remainder Sort
- Find a peak element in Linked List
- Program to print the Zigzag pattern
- Find the largest good number in the divisors of given number N
- Check if there is any common character in two given strings
- How to access elements of a Square Matrix
- Meta Binary Search | One-Sided Binary Search
- Product of all nodes in a doubly linked list divisible by a given number K
- Check if it is possible to return to the starting position after moving in the given directions
- Find Sum of pair from two arrays with maximum sum
- Product of the nodes of a Singly Linked List
- Check whether it is possible to join two points given on circle such that distance between them is k
- Maximize the number of subarrays with XOR as zero
- Pair with given sum in matrix
- Check if a pair with given absolute difference exists in a Matrix
- Find the sum of all highest occurring elements in an Array
- Sum of all minimum occurring elements in an Array
- Iterative program to find distance of a node from root
- Sum of squares of Fibonacci numbers
- Remove BST Keys in a given Range
- Ulam Number Sequence
- Sum of all prime numbers in an Array
- Find pairs with given product in a sorted Doubly Linked List
- Check if there exists any sub-sequence in a string which is not palindrome
- Check if suffix and prefix of a string are palindromes
- Find the winner of the game with N piles of boxes
- Program to Print Mirrored Hollow Parallelogram
- Sum of the alternate nodes of linked list
- Kth prime number greater than N
- All vertex pairs connected with exactly k edges in a graph
- Largest element in the array that is repeated exactly k times
- Sum of Fibonacci numbers at even indexes upto N terms
- Check if a pair with given product exists in Linked list
- Find the node with maximum value in a Binary Search Tree
- Sort prime numbers of an array in descending order
- How to convert Vector to array in Java
- Search in a sorted 2D matrix (Stored in row major order)
- Rearrange all elements of array which are multiples of x in increasing order
- Maximum no. of contiguous Prime Numbers in an array
- Remove characters from string that appears strictly less than K times
- Check if any permutation of N equals any power of K
- Check if it is possible to rearrange a binary string with alternate 0s and 1s
- Check if there is any pair in a given range with GCD is divisible by k
- Get K-th letter of the decoded string formed by repeating substrings
- Check if a string contains a palindromic sub-string of even length
- Remove elements from the array which appear more than k times
- Replace every elements in the array by its frequency in the array
- Find the foot of perpendicular of a point in a 3 D plane
- Remove elements from the array whose frequency lies in the range [l, r]
- Find number of cavities in a matrix
- Immediate smallest number after re-arranging the digits of a given number
- Replace every array element by sum of previous and next
- String matching with * (that matches with any) in any of the two strings
- Assign other value to a variable from two possible values
- Minimize Cost with Replacement with other allowed
- String with frequency of characters in Lucas Sequence
- Replace consonants with next immediate consonants alphabetically in a String
- Array elements with prime frequencies
- Sum and Product of all the nodes which are less than K in the linked list
- XOR of all Prime numbers in an Array
- Check whether it is possible to make both arrays equal by modifying a single element
- Number of words in a camelcase sequence
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check whether product of digits at even places of a number is divisible by K
- Shortest distance to every other character from given character
- XOR of Prime Frequencies of Characters in a String
- Longest subarray with elements having equal modulo K
- N digit numbers divisible by 5 formed from the M digits
- Replace every element with the smallest element on its left side
- Replace each element by the difference of the total size of the array and frequency of that element
- Check if the Xor of the frequency of all digits of a number N is zero or not
- Magical Pattern
- Minimum number of elements to be replaced to make the given array a Fibonacci Sequence
- Program to print hollow Triangle pattern
- Mode
- Find the count of palindromic sub-string of a string in its sorted form
- Check whether a given binary tree is skewed binary tree or not?
- Minimum swaps to group similar characters side by side?
- Count the number of words having sum of ASCII values less than and greater than k
- XOR of all elements of array with set bits equal to K
- Count number of bits changed after adding 1 to given N
- Find the value of f(n) / f(r) * f(n-r)
- Infix to Postfix using different Precedence Values for In-Stack and Out-Stack
- Maximum litres of water that can be bought with N Rupees
- Find the player who rearranges the characters to get a palindrome string first
- Check whether the frequencies of all the characters in a string are prime or not
- Program to remove consonants from a String
- Count distinct pairs from two arrays having same sum of digits
- Double ended priority queue
- Check if two nodes are in same subtree of the root node
- Minimum number of characters to be replaced to make a given string Palindrome
- Generate a sequence with the given operations
- Check if the given push and pop sequences of Stack is valid or not
- Sort perfect squares in an array at their relative positions
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
- Number of ways to reach the end of matrix with non-zero AND value
- Program to convert the diagonal elements of the matrix to 0
- Find minimum steps required to reach the end of a matrix | Set - 1
- Sum of elements whose square root is present in the array
- Program to find average of all nodes in a Linked List
- Reverse middle words of a string
- Check if elements of an array can be arranged satisfying the given condition
- Check if the given decimal number has 0 and 1 digits only
- Fraction
- Program to print the given H Pattern
- Update adjacent nodes if the current node is zero in a Singly Linked List
- Check if moves in a stack or queue are possible or not
- Recursive program to print all subsets with given sum
- Add index to characters and reverse the string
- Count of Numbers in a Range where digit d occurs exactly K times
- Difference between Recursion and Iteration
- Program for converting hours into minutes and seconds
- Buy minimum items without change and given coins
- Convert a String into a square matrix grid of characters
- Check if a number is perfect square without finding square root
- Represent n as the sum of exactly k powers of two | Set 2
- Shortest root to leaf path sum equal to a given number
- Find probability that a player wins when probabilities of hitting the target are given
- Probability that a N digit number is palindrome
- Number of subarrays have bitwise OR >= K
- Count of pairs violating BST property
- Smallest multiple of 3 which consists of three given non-zero digits
- Largest right circular cylinder that can be inscribed within a cone which is in turn inscribed within a cube
- Count distinct elements in an array
- Check if a string can be repeated to make another string
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Check whether the given character is in upper case, lower case or non alphabetic character
- Find safe cells in a matrix
- Predictor-Corrector or Modified-Euler method for solving Differential equation
- Find the Side of the smallest Square that can contain given 4 Big Squares
- Check if a number can be represented as a sum of 2 triangular numbers
- Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
- Minimum replacements to make adjacent characters unequal in a ternary string
- Closest sum partition (into two subsets) of numbers from 1 to n
- Operations required to make the string empty
- Form lexicographically smallest string with minimum replacements having equal number of 0s, 1s and 2s
- Number of sub-strings that contain the given character exactly k times
- Lexicographically largest sub-sequence of the given string
- Number of ways to choose an integer such that there are exactly K elements greater than it in the given array
- Sum of minimum elements of all possible sub-arrays of an array
- Find sub-matrix with the given sum
- Program to reverse a linked list using Stack
- Print Leaf Nodes at a given Level
- DFA for accepting the language L = {a
^{n}b^{m}| n+m=odd} - Find a positive number M such that gcd(N^M, N&M) is maximum
- Given two binary strings perform operation until B > 0 and print the result
- Smallest Special Prime which is greater than or equal to a given number
- Split the array into odd number of segments of odd lengths
- Maximum Bitwise AND pair from given range
- Sum of all Submatrices of a Given Matrix
- Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
- Count array elements that divide the sum of all other elements
- Find the maximum value permutation of a graph
- Find Nth positive number whose digital root is X
- Sum of bitwise AND of all submatrices
- Sum of Bitwise-OR of all Submatrices
- Count Numbers in Range with difference between Sum of digits at even and odd positions as Prime
- Number of connected components in a 2-D matrix of strings
- Longest subsequence such that adjacent elements have at least one common digit
- Minimum changes required to make a Catalan Sequence
- Count all elements in the array which appears at least K times after their first occurrence
- Two equal sum segment range queries
- Count of all even numbers in the range [L, R] whose sum of digits is divisible by 3
- Sum of numbers from 1 to N which are in Lucas Sequence
- Bitwise OR of N binary strings
- Minimize sum of adjacent difference with removal of one element from array
- Group consecutive characters of same type in a string
- Probability of A winning the match when individual probabilities of hitting the target given
- Minimum number of replacements to make the binary string alternating | Set 2
- Longest double string from a Palindrome
- Print the last k nodes of the linked list in reverse order | Iterative Approaches
- Ways to form a group from three groups with given constraints
- Minimum number of bracket reversals needed to make an expression balanced | Set - 2
- Sum of the series (1*2) + (2*3) + (3*4) + ...... upto n terms
- Numbers that are not divisible by any number in the range [2, 10]
- Find the K-th minimum element from an array concatenated M times
- Maximum number that can be display on Seven Segment Display using N segments
- Program to calculate the value of nPr
- Check if the given array is mirror-inverse
- Minimum steps to make all the elements of the array divisible by 4
- Character whose frequency is equal to the sum of frequencies of other characters of the given string
- Find the side of the squares which are inclined diagonally and lined in a row
- Addition of two numbers without propagating Carry
- Find the sum of all Truncatable primes below N
- Search an element in given N ranges
- Minimum cuts required to convert a palindromic string to a different palindromic string
- Find maximum N such that the sum of square of first N natural numbers is not more than X
- Generate array with minimum sum which can be deleted in P steps
- Check if matrix can be converted to another matrix by transposing square sub-matrices
- Minimum changes required such that the string satisfies the given condition
- Find if the given number is present in the infinite sequence or not
- Find the number of good permutations
- Check if the given array can be reduced to zeros with the given operation performed given number of times
- Minimum length of square to contain at least half of the given Coordinates
- Count integers in a range which are divisible by their euler totient value
- Number of ways to make binary string of length N such that 0s always occur together in groups of size K
- Count sub-arrays whose product is divisible by k
- Find foot of perpendicular from a point in 2 D plane to a Line
- Find a pair from the given array with maximum nCr value
- Minimum steps to delete a string by deleting substring comprising of same characters
- Find a distinct pair (x, y) in given range such that x divides y
- Find the number of ways to divide number into four parts such that a = c and b = d
- Find 2^(2^A) % B
- Check if the given binary tree has a sub-tree with equal no of 1's and 0's | Set 2
- Maximize the value of the given expression
- Programs for printing pyramid patterns using recursion
- Sum of Fibonacci Numbers in a range
- Minimize the cost to split a number
- Total distinct pairs of ugly numbers from two arrays
- Count of sub-arrays whose elements can be re-arranged to form palindromes
- Construct Binary Tree from given Parent Array representation | Iterative Approach
- Partition the array into three equal sum segments
- Determine the number of squares of unit area that a given line will pass through.
- Find the good permutation of first N natural numbers
- Sum of degrees of all nodes of a undirected graph
- Find the hypotenuse of a right angled triangle with given two sides
- Distinct pairs from given arrays (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number
- Sort ugly numbers in an array at their relative positions
- Reverse Clockwise spiral traversal of a binary tree
- Iterative approach to check if a Binary Tree is Perfect
- Iterative approach to check for children sum property in a Binary Tree
- Print all leaf nodes of a binary tree from right to left
- Count of sub-strings that do not contain all the characters from the set {'a', 'b', 'c'} at the same time
- Find the number of different numbers in the array after applying the given operation q times
- XOR of all the elements in the given range [L, R]
- Arrange given numbers to form the smallest number
- Compare two strings considering only alphanumeric characters
- Find maximum in stack in O(1) without using additional stack
- Find the final radiations of each Radiated Stations
- Find number of edges that can be broken in a tree such that Bitwise OR of resulting two trees are equal
- Sum of nodes in a linked list which are greater than next node
- Count number of binary strings of length N having only 0's and 1's
- Maximum number of people that can be killed with strength P
- Length of the smallest number which is divisible by K and formed by using 1's only
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Reduce the fraction to its lowest form
- Iterative selection sort for linked list
- Print path from root to all nodes in a Complete Binary Tree
- Insert N elements in a Linked List one after other at middle position
- Minimum sub-array such that number of 1's in concatenation of binary representation of its elements is at least K
- Find the minimum number of operations required to make all array elements equal
- Sum of all distinct nodes in a linked list
- Sum of smaller elements of nodes in a linked list
- Count of quadruplets with given Sum
- Queries to answer the number of ones and zero to the left of given index
- Check if two strings are same ignoring their cases
- Find the sum of the number of divisors
- Travelling Salesman Problem implementation using BackTracking
- Queries to check if substring[L...R] is palindrome or not
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Maximum length cycle that can be formed by joining two nodes of a binary tree
- Minimum length of the sub-string whose characters can be used to form a palindrome of length K
- Check whether N is a Dihedral Prime Number or not
- Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
- Check whether the given string is a valid identifier
- Find the nth term of the given series
- Find the sum of leafs at maximum level
- Queries to update a given index and find gcd in range
- Remove all occurrences of any element for maximum array sum
- Highest power of a number that divides other number
- Maximum elements which can be crossed using given units of a and b
- Sum of the series 1, 2, 4, 3, 5, 7, 9, 6, 8, 10, 11, 13.. till N-th term
- Check if given two straight lines are identical or not
- Game Theory in Balanced Ternary Numeral System | (Moving 3k steps at a time)
- Find sum of factorials in an array
- Count of quadruplets with given Sum | Set 2
- Find the Diameter or Longest chord of a Circle
- Determine the position of the third person on regular N sided polygon
- Length of the chord of the circle whose radius and the angle subtended at the center by the chord is given
- Maximum sum of leaf nodes among all levels of the given binary tree
- Reorder the position of the words in alphabetical order
- Given two arrays count all pairs whose sum is an odd number
- Print steps to make a number in form of 2^X - 1
- Length of the direct common tangent between two externally touching circles
- Maximize the given number by replacing a segment of digits with the alternate digits given
- Count unique numbers that can be generated from N by adding one and removing trailing zeros
- Find element with the maximum set bits in an array
- Minimum number of cubes whose sum equals to given number N
- Generate an array of K elements such that sum of elements is N and the condition a[i] < a[i+1] <= 2*a[i] is met | Set 2
- Calculate score for the given binary string
- Count number of 1s in the array after N moves
- Area of plot remaining at the end
- Minimum increments to convert to an array of consecutive integers
- Minimum deletions required such that any number X will occur exactly X times
- Count number of subsets whose median is also present in the same subset
- Ratio of the distance between the centers of the circles and the point of intersection of two direct common tangents to the circles
- Minimum operations required to change the array such that |arr[i] - M| <= 1
- Maximum sum path in a matrix from top to bottom and back
- Minimum number of given operations required to reduce the array to 0 element
- Find prime number K in an array such that (A[i] % K) is maximum
- Create linked list from a given array
- Create a sequence whose XOR of elements is y
- Count squares with odd side length in Chessboard
- Check if the number is valid when flipped upside down
- Find minimum steps required to reach the end of a matrix | Set 2
- Minimize the number of steps required to reach the end of the array | Set 2
- Minimum steps required to reach the end of a matrix | Set 2
- Queries for bitwise AND in the index range [L, R] of the given array
- Remove elements to make array satisfy arr[ i+1] < arr[i] for each valid i
- Program to find the number of men initially
- Count the nodes of the given tree whose weight has X as a factor
- Maximum Sum Subsequence of length k
- Change one element in the given array to make it an Arithmetic Progression
- Count number of ways to divide an array into two halves with same sum
- Check if each element of the given array is the product of exactly K prime numbers
- Number of ways to divide an array into K equal sum sub-arrays
- Count duplicates in a given linked list
- Print combinations of distinct numbers which add up to give sum N
- Find the largest possible k-multiple set
- Find the sum of the ascii values of characters which are present at prime positions
- Count of three non-overlapping sub-strings which on concatenation forms a palindrome
- Maximise array sum after taking non-overlapping sub-arrays of length K
- Sum of XOR of all sub-arrays of length K
- Count the number of digits of palindrome numbers in an array
- Count the maximum number of elements that can be selected from the array
- Find uncommon characters of the two strings | Set 2
- Minimum length subarray of 1s in a Binary Array
- Count number of distinct substrings of a given length
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Longest prefix in a string with highest frequency
- Maximum sub-sequence sum such that indices of any two adjacent elements differs at least by 3
- Find the node with minimum value in a Binary Search Tree using recursion
- Queries for number of distinct elements from a given index till last index in an array
- Reverse the Sentence using Stack
- Minimum time required to rot all oranges | Dynamic Programming
- Rearrange characters in a string such that no two adjacent are same using hashing
- Find Nth smallest number that is divisible by 100 exactly K times
- Kth smallest element in the array using constant space when array can't be modified
- Check whether it is possible to convert A into B
- Check whether str1 can be converted to str2 with the given operations
- Number of elements from the array which are reachable after performing given operations on D
- Maximum previous and next element product
- Find the minimum number of elements that should be removed to make an array good
- Find XOR of numbers from the range [L, R]
- Construct a DFA which accept the language L = {w | w ∈ {a,b}* and Na(w) mod 3 = Nb (w) mod 3}
- Construct a DFA which accept the language L = {a
^{n}b^{m}| n > =1, (m) mod 3 = 1} - Reverse alternate K nodes in a Singly Linked List - Iterative Solution
- Find two vertices of an isosceles triangle in which there is rectangle with opposite corners (0, 0) and (X, Y)
- Minimum number of adjacent swaps to convert a string into its given anagram
- Probability of getting more heads than tails when N biased coins are tossed
- Coin Change | BFS Approach
- Minimum number of steps to convert a given matrix into Upper Hessenberg matrix
- Program to calculate the area of Kite
- Flatten Binary Tree in order of Level Order Traversal
- Sum of Semi-Prime Numbers less than or equal to N
- Nodes from given two BSTs with sum equal to X
- Partiton the string in two parts such that both parts have at least k different characters
- Find the position of the given row in a 2-D array
- Unbounded Fractional Knapsack
- Find Leftmost and Rightmost node of BST from its given preorder traversal
- Distinct adjacent elements in a binary array
- Find a partition point in array to maximize its xor sum
- Count of non-overlapping sub-strings "101" and "010" in the given binary string
- Programs to print Triangle and Diamond patterns using recursion
- Splitting starting N nodes into new Circular Linked List while preserving the old nodes
- Print the lexicographically smallest array by swapping elements whose sum is odd
- Generate all possible strings such that char at index i is either str1[i] or str2[i]
- Longest subsequence such that every element in the subsequence is formed by multiplying previous element with a prime
- Maximum length sub-array which satisfies the given conditions
- Sum of the Tan(x) expansion upto N terms
- Alternate XOR operations on sorted array
- Longest sub string of 0's in a binary string which is repeated K times
- Number of balanced parenthesis substrings
- Remove minimum elements from the array such that 2*min becomes more than max
- All unique combinations whose sum equals to K
- Time taken per hour for stoppage of Car
- Find the difference of count of equal elements on the right and the left for each element
- Lexicographically largest permutation of the array such that a[i] = a[i-1] + gcd(a[i-1], a[i-2])
- Smallest power of 4 greater than or equal to N
- Alcuin's Sequence
- Gijswijt's Sequence
- Subtraction of the alternate nodes of Linked List
- Count of all possible pairs of disjoint subsets of integers from 1 to N
- Print all the peaks and troughs in an Array of Integers
- Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized
- Sum of even elements of an Array using Recursion
- Maximum Bitwise AND value of subsequence of length K
- Product of Primes of all Subsets
- Largest substring with same Characters
- Maximum value of division of two numbers in an Array
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Nambiar Number Generator
- Remove Nth node from end of the Linked List
- FCFS Disk Scheduling Algorithms
- Bit manipulation | Swap Endianness of a number
- Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
- Check whether Quadrilateral is valid or not if angles are given
- How to learn Pattern printing easily?
- Find the smallest positive number missing from an unsorted array | Set 3
- Lexicographical smallest alternate Array
- Equal Sum and XOR of three Numbers
- Number of Subsequences with Even and Odd Sum
- Print the season name of the year based on the month number
- Print all the permutation of length L using the elements of an array | Iterative
- Lexicographical ordering using Heap Sort
- Check if it is possible to perform the given Grid Division
- Maximum XOR of Two Numbers in an Array
- Delete the last leaf node in a Binary Tree
- Find Kth element in an array containing odd elements first and then even elements
- Ways to choose balls such that at least one ball is chosen
- Generate N integers satisfying the given conditions
- Find the first N integers such that the sum of their digits is equal to 10
- Maximum subsequence sum such that all elements are K distance apart
- Count the values greater than X in the modified array
- Sum of absolute differences of pairs from the given array that satisfy the given condition
- Find the minimum value from an array associated with another array
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Queries for the smallest and the largest prime number of given digit
- Count of numbers below N whose sum of prime divisors is K
- Find the count of subsequences where each element is divisible by K
- Count occurrences of a prime number in the prime factorization of every element from the given range