29AjayKumar
29AjayKumar
  1. Remove duplicates from a given string
  2. Given only a pointer/reference to a node to be deleted in a singly linked list, how do you delete it?
  3. Detect loop in a linked list
  4. Write a Program to Find the Maximum Depth or Height of a Tree
  5. Convert a Binary Tree into its Mirror Tree
  6. Write a function to get the intersection point of two Linked Lists
  7. Given a linked list which is sorted, how will you insert in sorted way
  8. Compute the minimum or maximum of two integers without branching
  9. A program to check if a binary tree is BST or not
  10. Merge two sorted linked lists
  11. Queue using Stacks
  12. Remove duplicates from a sorted linked list
  13. Reverse a Doubly Linked List
  14. Maximum difference between two elements such that larger element appears after the smaller number
  15. Check for balanced parentheses in an expression
  16. Count of Binary Digit numbers smaller than N
  17. Delete alternate nodes of a Linked List
  18. Find the two repeating elements in a given array
  19. Reverse a Linked List in groups of given size | Set 1
  20. Evaluation order of operands
  21. Find duplicates in O(n) time and O(1) extra space | Set 1
  22. Program for Fibonacci numbers
  23. Print a given matrix in spiral form
  24. Sliding Window Maximum (Maximum of all subarrays of size k)
  25. Reverse alternate K nodes in a Singly Linked List
  26. Segregate even and odd nodes in a Linked List
  27. Detect and Remove Loop in a Linked List
  28. Find whether an array is subset of another array | Added Method 3
  29. Sudoku | Backtracking-7
  30. Smallest of three integers without comparison operators
  31. Check whether two strings are anagram of each other
  32. Find a triplet that sum to a given value
  33. K'th smallest element in BST using O(1) Extra Space
  34. Find the smallest positive number missing from an unsorted array | Set 1
  35. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  36. Find the element that appears once
  37. Lexicographic rank of a string
  38. Given a sequence of words, print all anagrams together | Set 2
  39. Transitive closure of a graph
  40. Sort a linked list of 0s, 1s and 2s
  41. The Stock Span Problem
  42. Largest Independent Set Problem | DP-26
  43. Find multiplication of sums of data of leaves at same levels
  44. Tug of War
  45. QuickSort on Doubly Linked List
  46. Dice Throw | DP-30
  47. Swap Kth node from beginning with Kth node from end in a Linked List
  48. Iterative Method to find Height of Binary Tree
  49. Check for Identical BSTs without building the trees
  50. QuickSort on Singly Linked List
  51. Merge k sorted arrays | Set 1
  52. Difference between sums of odd level and even level nodes of a Binary Tree
  53. Check if all leaves are at same level
  54. Extract Leaves of a Binary Tree in a Doubly Linked List
  55. Find the first non-repeating character from a stream of characters
  56. Find next right node of a given key
  57. Find LCA in Binary Tree using RMQ
  58. Remove minimum elements from either side such that 2*min becomes more than max
  59. Search in a Row-wise and Column-wise Sorted 2D Array using Divide and Conquer algorithm
  60. Program for nth Catalan Number
  61. Boolean Parenthesization Problem | DP-37
  62. Channel Assignment Problem
  63. Find next greater number with same set of digits
  64. Shortest path with exactly k edges in a directed and weighted graph
  65. Pattern Searching using a Trie of all Suffixes
  66. Mobile Numeric Keypad Problem
  67. Snake and Ladder Problem
  68. Convert a Binary Tree to Threaded binary tree | Set 1 (Using Queue)
  69. Multiply two polynomials
  70. K'th Smallest/Largest Element in Unsorted Array | Set 1
  71. K'th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
  72. K'th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
  73. K'th Smallest/Largest Element in Unsorted Array | Set 3 (Worst Case Linear Time)
  74. Flood fill Algorithm - how to implement fill() in paint?
  75. Check if a given array contains duplicate elements within k distance from each other
  76. Find a common element in all rows of a given row-wise sorted matrix
  77. Rearrange an array such that 'arr[j]' becomes 'i' if 'arr[i]' is 'j' | Set 1
  78. Find number of days between two given dates
  79. Find the longest substring with k unique characters in a given string
  80. Swap nodes in a linked list without swapping data
  81. Merge Sort for Doubly Linked List
  82. Select a Random Node from a Singly Linked List
  83. Sort an almost sorted array where only two elements are swapped
  84. Remove spaces from a given string
  85. Count total number of N digit numbers such that the difference between sum of even and odd digits is 1
  86. Print string of odd length in 'X' format
  87. Find the largest rectangle of 1's with swapping of columns allowed
  88. Find all possible outcomes of a given expression
  89. Maximum weight transformation of a given string
  90. Given an array of pairs, find all symmetric pairs in it
  91. Longest Repeating Subsequence
  92. How to check if a given array represents a Binary Heap?
  93. Find minimum possible size of array with given rules for removing elements
  94. Find Minimum Depth of a Binary Tree
  95. Range Minimum Query (Square Root Decomposition and Sparse Table)
  96. Print all Jumping Numbers smaller than or equal to a given value
  97. Reorder an array according to given indexes
  98. Combinatorial Game Theory | Set 3 (Grundy Numbers/Nimbers and Mex)
  99. Merge two sorted linked lists such that merged list is in reverse order
  100. Print individual digits as words without using if or switch
  101. Merge two sorted arrays with O(1) extra space
  102. Count Integral points inside a Triangle
  103. Form minimum number from given sequence
  104. How to avoid overflow in modular multiplication?
  105. 1's and 2's complement of a Binary Number
  106. Check whether given degrees of vertices represent a Graph or Tree
  107. Bin Packing Problem (Minimize number of used Bins)
  108. Count numbers having 0 as a digit
  109. Printing Paths in Dijkstra's Shortest Path Algorithm
  110. Querying maximum number of divisors that a number in a given range has
  111. Construct Ancestor Matrix from a Given Binary Tree
  112. Point arbit pointer to greatest value right side node in a linked list
  113. Non-recursive program to delete an entire binary tree
  114. GCDs of given index ranges in an array
  115. Common elements in all rows of a given matrix
  116. Sort linked list which is already sorted on absolute values
  117. Rearrange array in alternating positive & negative items with O(1) extra space | Set 2
  118. Printing Shortest Common Supersequence
  119. Maximum product of a triplet (subsequnece of size 3) in array
  120. Find maximum length Snake sequence
  121. Find smallest range containing elements from k lists
  122. Find if string is K-Palindrome or not | Set 1
  123. Delete middle of linked list
  124. Check if a linked list is Circular Linked List
  125. Longest Common Prefix using Word by Word Matching
  126. Find frequency of each element in a limited range array in less than O(n) time
  127. Number of ways to calculate a target number using only array elements
  128. Rearrange a string so that all same characters become atleast d distance away
  129. How to find Lexicographically previous permutation?
  130. Longest Common Prefix using Divide and Conquer Algorithm
  131. Maximum value K such that array has at-least K elements that are >= K
  132. Lower case to upper case - An interesting fact
  133. Find even occurring elements in an array of limited range
  134. Heap's Algorithm for generating permutations
  135. Printing Longest Common Subsequence | Set 2 (Printing All)
  136. Program to convert a given number to words | Set 2
  137. Rearrange positive and negative numbers with constant extra space
  138. Range LCM Queries
  139. Generate 0 and 1 with 25% and 75% probability
  140. Sub-string Divisibility by 3 Queries
  141. Find longest palindrome formed by removing or shuffling chars from string
  142. Longest Geometric Progression
  143. Find all strings that match specific pattern in a dictionary
  144. Find height of a special binary tree whose leaf nodes are connected
  145. Reverse an array in groups of given size | Set 2 (Variations of Set 1 )
  146. Find if an expression has duplicate parenthesis or not
  147. Third largest element in an array of distinct elements
  148. Subtract Two Numbers represented as Linked Lists
  149. A Space Optimized DP solution for 0-1 Knapsack Problem
  150. Find Two Missing Numbers | Set 1 (An Interesting Linear Time Solution)
  151. Count digit groupings of a number with given constraints
  152. Count Distinct Subsequences
  153. Find minimum elements after considering all possible transformations
  154. Maximum Consecutive Increasing Path Length in Binary Tree
  155. Pairs of complete strings in two sets of strings
  156. Frequency Measuring Techniques for Competitive Programming
  157. Count and Toggle Queries on a Binary Array
  158. Vigenère Cipher
  159. Remove Invalid Parentheses
  160. Longest common subsequence with permutations allowed
  161. Longest consecutive sequence in Binary tree
  162. Check if a string has all characters with same frequency with one variation allowed
  163. Check if a string can become empty by recursively deleting a given sub-string
  164. Remove minimum number of characters so that two strings become anagram
  165. XOR Cipher
  166. Count all pairs with given XOR
  167. Find pairs with given sum in doubly linked list
  168. Find maximum difference between nearest left and right smaller elements
  169. Sort a string according to the order defined by another string
  170. Distinct strings with odd and even changes allowed
  171. Sum of maximum elements of all subsets
  172. Find Maximum Sum Strictly Increasing Subarray
  173. Count characters at same position as in English alphabet
  174. Minimum Product Spanning Tree
  175. Maximum subsequence sum such that no three are consecutive
  176. Maximum sum of nodes in Binary tree such that no two are adjacent
  177. Find all sides of a right angled triangle from given hypotenuse and area | Set 1
  178. Count pairs whose products exist in array
  179. Count minimum number of "move-to-front" moves to sort an array
  180. Minimum characters to be added at front to make string palindrome
  181. Print all nodes in a binary tree having K leaves
  182. Minimum difference between adjacent elements of array which contain elements from each row of a matrix
  183. Maximum 0's between two immediate 1's in binary representation
  184. Find all permuted rows of a given row in a matrix
  185. Sort even-placed elements in increasing and odd-placed in decreasing order
  186. Find the first natural number whose factorial is divisible by x
  187. Sort an array when two halves are sorted
  188. Program to toggle all characters in a string
  189. Minimum number of elements which are not part of Increasing or decreasing subsequence in array
  190. LCS (Longest Common Subsequence) of three strings
  191. Check linked list with a loop is palindrome or not
  192. Find Maximum dot product of two arrays with insertion of 0's
  193. Rearrange an array to minimize sum of product of consecutive pair elements
  194. Find pairs in array whose sums already exist in array
  195. K-th smallest element after removing some integers from natural numbers
  196. Sqrt (or Square Root) Decomposition Technique | Set 1 (Introduction)
  197. Break an array into maximum number of sub-arrays such that their averages are same
  198. Find three element from different three arrays such that a + b + c = sum
  199. Queries on substring palindrome formation
  200. Count of index pairs with equal elements in an array
  201. Boggle | Set 2 (Using Trie)
  202. Maximum difference between frequency of two elements such that element having greater frequency is also greater
  203. Friends Pairing Problem
  204. Printing all solutions in N-Queen Problem
  205. Count binary strings with k times appearing adjacent two set bits
  206. Program for FCFS CPU Scheduling | Set 1
  207. Check if reversing a sub array make the array sorted
  208. Minimum operations required to remove an array
  209. Find all triplets with zero sum
  210. Number of subsequences in a string divisible by n
  211. Print consecutive characters together in a line
  212. Pizza cut problem (Or Circle Division by Lines)
  213. Check if a Binary Tree contains duplicate subtrees of size 2 or more
  214. Program for Worst Fit algorithm in Memory Management
  215. Number with maximum number of prime factors
  216. Nearest element with at-least one common prime factor
  217. Type of array and its maximum element
  218. Sort array after converting elements to their squares
  219. Sort all even numbers in ascending order and then sort all odd numbers in descending order
  220. Find N'th item in a set formed by sum of two arrays
  221. Program for Banker's Algorithm | Set 1 (Safety Algorithm)
  222. Make largest palindrome by changing at most K-digits
  223. Word formation using concatenation of two dictionary words
  224. Find largest word in dictionary by deleting some characters of given string
  225. Largest divisible subset in array
  226. Count of strings that can be formed using a, b and c under given constraints
  227. Maximum edge removal from tree to make even forest
  228. Find the missing number in a string of numbers with no separator
  229. Count substrings with same first and last characters
  230. Find the Deepest Node in a Binary Tree
  231. Print all full nodes in a Binary Tree
  232. Convert decimal fraction to binary number
  233. Find sum of non-repeating (distinct) elements in an array
  234. Number of pair of positions in matrix which are not accessible
  235. Find the largest multiple of 3 from array of digits | Set 2 (In O(n) time and O(1) space)
  236. Move all occurrences of an element to end in a linked list
  237. Deletion from a Circular Linked List
  238. Iterative program to count leaf nodes in a Binary Tree
  239. Finding LCM of more than two (or array) numbers without using GCD
  240. Prufer Code to Tree Creation
  241. Count the number of subarrays having a given XOR
  242. Find the next identical calendar year
  243. Nth Square free number
  244. Binary Search Tree insert with Parent Pointer
  245. Doubly Circular Linked List | Set 2 (Deletion)
  246. Smallest length string with repeated replacement of two distinct adjacent
  247. Find first non matching leaves in two binary trees
  248. Largest subset of Graph vertices with edges of 2 or more colors
  249. Count of arrays in which all adjacent elements are such that one of them divide the another
  250. Number of sink nodes in a graph
  251. How to implement decrease key or change key in Binary Search Tree?
  252. Lexicographically minimum string rotation | Set 1
  253. Generate all binary permutations such that there are more or equal 1's than 0's before every point in all permutations
  254. Print All Distinct Elements of a given integer array
  255. Program to add two polynomials
  256. Connected Components in an undirected graph
  257. Greedy Algorithm to find Minimum number of Coins
  258. Remove recurring digits in a given number
  259. Check if a sorted array can be divided in pairs whose sum is k
  260. Print level order traversal line by line | Set 1
  261. Linked List | Set 1 (Introduction)
  262. Doubly Linked List | Set 1 (Introduction and Insertion)
  263. Find Length of a Linked List (Iterative and Recursive)
  264. Delete last occurrence of an item from linked list
  265. Stack | Set 3 (Reverse a string using stack)
  266. Number of subtrees having odd count of even numbers
  267. Minimum number of Appends needed to make a string palindrome
  268. Move spaces to front of string in single traversal
  269. Find distance from root to given node in a binary tree
  270. Count full nodes in a Binary tree (Iterative and Recursive)
  271. Count numbers whose sum with x is equal to XOR with x
  272. Binary representation of next greater number with same number of 1's and 0's
  273. TimSort
  274. Threaded Binary Search Tree | Deletion
  275. Reverse an array without using subtract sign ‘-‘ anywhere in the code
  276. First element occurring k times in an array
  277. K-th Element of Two Sorted Arrays
  278. Print array of strings in sorted order without copying one string into another
  279. Determine if a string has all Unique Characters
  280. Find index of an extra element present in one sorted array
  281. Shortest Uncommon Subsequence
  282. Averages of Levels in Binary Tree
  283. Find the n-th number made of even digits only
  284. Biggest number by arranging numbers in certain order
  285. Program to find Smallest and Largest Word in a String
  286. Program to remove vowels from a String
  287. Removing punctuations from a given string
  288. Minimum edge reversals to make a root
  289. Output of Java program | Set 22 (Overloading)
  290. Sum of divisors of factorial of a number
  291. First negative integer in every window of size k
  292. Sum of product of all pairs of array elements
  293. Check if two numbers are bit rotations of each other or not
  294. Iterative method to check if two trees are mirror of each other
  295. Program to calculate the value of sin(x) and cos(x) using Expansion
  296. Check whether given string can be generated after concatenating given strings
  297. String containing first letter of every word in a given string with spaces
  298. Maximizing Unique Pairs from two arrays
  299. Find mirror of a given node in Binary tree
  300. Print the path common to the two paths from the root to the two given nodes
  301. Reverse vowels in a given string
  302. Find minimum value to assign all array elements so that array product becomes greater
  303. Count of only repeated element in a sorted array of consecutive elements
  304. Non-overlapping sum of two sets
  305. Boyer Moore Algorithm | Good Suffix heuristic
  306. Bubble sort using two Stacks
  307. Count pairs from two sorted arrays whose sum is equal to a given value x
  308. Find number of diagonals in n sided convex polygon
  309. Find Corners of Rectangle using mid points
  310. Length of the transverse common tangent between the two non intersecting circles
  311. Program to find line passing through 2 Points
  312. Check if a string is Isogram or not
  313. Multistage Graph (Shortest Path)
  314. Check if absolute difference of consecutive nodes is 1 in Linked List
  315. Find a pair of elements swapping which makes sum of two arrays same
  316. Check if an array represents Inorder of Binary Search tree or not
  317. Print all permutation of a string using ArrayList
  318. Find the sum of last n nodes of the given Linked List
  319. Sum of product of all elements of sub-arrays of size k
  320. Maximize matrix as per given condition
  321. Count pairs from two linked lists whose sum is equal to a given value
  322. Find the Sub-array with sum closest to 0
  323. Count quadruples from four sorted arrays whose sum is equal to a given value x
  324. Given a number as a string, find the number of contiguous subsequences which recursively add up to 9 | Set 2
  325. Largest number in BST which is less than or equal to N
  326. Find k-th bit in a binary string created by repeated invert and append operations
  327. Keyword Cipher
  328. Program for Shortest Job First (SJF) scheduling | Set 2 (Preemptive)
  329. Print the string after the specified character has occurred given no. of times
  330. Remove duplicates from a sorted doubly linked list
  331. Squareroot(n)-th node in a Linked List
  332. Print last k digits of a^b (a raised to power b)
  333. Shuffle 2n integers in format {a1, b1, a2, b2, a3, b3, ......, an, bn} without using extra space
  334. Null Cipher
  335. Print odd positioned nodes of odd levels in level order of the given binary tree
  336. Find an element in Bitonic array
  337. Iterative method to find ancestors of a given binary tree
  338. Minimum rotations required to get the same string
  339. Maximize a given unsigned number number by swapping bits at it's extreme positions.
  340. Convert all substrings of length 'k' from base 'b' to decimal
  341. Preorder Successor of a Node in Binary Tree
  342. Check if binary representation of a given number and its complement are anagram
  343. Longest Prime Subarray after removing one element
  344. Next greater element in same order as input
  345. Minimum Index Sum for Common Elements of Two Lists
  346. Calculate number of nodes between two vertices in an acyclic Graph by Disjoint Union method
  347. Counts Path in an Array
  348. Remove brackets from an algebraic string containing + and - operators
  349. Check if a large number can be divided into two or more segments of equal sum
  350. Remove minimum number of elements such that no common element exist in both array
  351. Find if an array contains a string with one mismatch
  352. Check whether right angled triangle is valid or not for large sides
  353. Adding elements of an array until every element becomes greater than or equal to k
  354. Sum of all even numbers in range L and R
  355. Count subarrays with equal number of occurrences of two given elements
  356. Merge two sorted lists (in-place)
  357. Sort first half in ascending and second half in descending order | 1
  358. Length of the smallest sub-string consisting of maximum distinct characters
  359. Remove three consecutive duplicates from string
  360. Sum and Product of Prime Frequencies of Characters in a String
  361. Generating distinct subsequences of a given string in lexicographic order
  362. Sum triangle from array
  363. Balance pans using given weights that are powers of a number
  364. Print the nodes at odd levels of a tree
  365. Check if a grid can become row-wise and column-wise sorted after adjacent swaps
  366. Best meeting point in 2D binary array
  367. Maximum number of unique prime factors
  368. Minimum number of Square Free Divisors
  369. Sort an array according to absolute difference with a given value "using constant extra space"
  370. Check if two unsorted arrays (with duplicates allowed) have same elements
  371. Count all triplets whose sum is equal to a perfect cube
  372. Pattern Printing question asked in CGI Coding Round
  373. Lexicographically smallest permutation of {1, .. n} such that no. and position do not match
  374. Count number of digits after decimal on dividing a number
  375. Minimum operation to make all elements equal in array
  376. Insert a node after the n-th node from the end
  377. Check if a graphs has a cycle of odd length
  378. Number of substrings with count of each character as k
  379. Count unset bits of a number
  380. Array range queries over range queries
  381. Convert singly linked list into circular linked list
  382. Maximize the binary matrix by filpping submatrix once
  383. Remove array end element to maximize the sum of product
  384. Lexicographically first alternate vowel and consonant string
  385. Permutations to arrange N persons around a circular table
  386. K-th ancestor of a node in Binary Tree
  387. Generate two output strings depending upon occurrence of character in input string.
  388. Sort string of characters
  389. Right view of Binary Tree using Queue
  390. Number of ways to arrange N items under given constraints
  391. Count single node isolated sub-graphs in a disconnected graph
  392. Unique element in an array where all elements occur k times except one
  393. Kth ancestor of a node in binary tree | Set 2
  394. Largest number with one swap allowed
  395. Linked List Sum of Nodes Between 0s
  396. Check if a string is suffix of another
  397. Sudo Placement[1.4] | BST Traversal
  398. Longest alternating sub-array starting from every index in a Binary Array
  399. Generate all passwords from given character set
  400. Check whether a number has exactly three distinct factors or not
  401. Longest Repeated Subsequence
  402. Check if a two character string can be made using given words
  403. Node having maximum sum of immediate children and itself in n-ary tree
  404. Sort a Rotated Sorted Array
  405. Replace nodes with duplicates in linked list
  406. Number of triangles that can be formed
  407. Number of subarrays having absolute sum greater than K | Set-2
  408. Maximize value of (a[i]+i)*(a[j]+j) in an array
  409. Count of strings where adjacent characters are of difference one
  410. k-th missing element in increasing sequence which is not present in a given sequence
  411. Lexicographically smallest string whose hamming distance from given string is exactly K
  412. Generate permutations with only adjacent swaps allowed
  413. Tile Stacking Problem
  414. Print k numbers where all pairs are divisible by m
  415. Secretary Problem (A Optimal Stopping Problem)
  416. Pairs of Positive Negative values in an array
  417. Given a HUGE number check if it's a power of two.
  418. Remove all consecutive duplicates from the string
  419. Direction of a Point from a Line Segment
  420. Cumulative frequency of count of each element in an unsorted array
  421. Index Mapping (or Trivial Hashing) with negatives allowed
  422. Count of strings that can be formed from another string using each character at-most once
  423. Even numbers at even index and odd numbers at odd index
  424. Queries for the product of first N factorials
  425. Program to sort string in descending order
  426. Lexicographically smallest permutation with distinct elements using minimum replacements
  427. Double Base Palindrome
  428. Distinct permutations of the string | Set 2
  429. Minimum number of elements to add to make median equals x
  430. Average numbers in array
  431. Replace a character c1 with c2 and c2 with c1 in a string S
  432. Count all 0s which are blocked by 1s in binary matrix
  433. Remove all characters other than alphabets from string
  434. Recursive insertion and traversal linked list
  435. Root to leaf path with maximum distinct nodes
  436. Check whether the given array is perfect or not
  437. Largest increasing subsequence of consecutive integers
  438. Binary tree to string with brackets
  439. Make three non-empty sets with negative, positive and 0 products
  440. Sort an array with swapping only with a special element is allowed
  441. Sorting using trivial hash function
  442. Maximum consecutive numbers present in an array
  443. Count sub-arrays which have elements less than or equal to X
  444. Minimum Word Break
  445. Prime factors of a big number
  446. Frequency of a substring in a string
  447. Find index of closing bracket for a given opening bracket in an expression
  448. Smallest number whose set bits are maximum in a given range
  449. Next word that does not contain a palindrome and has characters from first k
  450. Construct lexicographically smallest palindrome
  451. Print Longest Palindromic Subsequence
  452. Camel case of a given sentence
  453. Minimum jumps to reach last building in a matrix
  454. Program to find the minimum (or maximum) element of an array
  455. Split the string into substrings using delimiter
  456. Minimum cost to construct a string
  457. Queries for maximum difference between prime numbers in given ranges
  458. Count subarrays where second highest lie before highest
  459. Game of replacing array elements
  460. DFS traversal of a tree using recursion
  461. Print n smallest elements from given array in their original order
  462. Encrypt string with product of number of vowels and consonants in substring of size k
  463. Construct a graph from given degrees of all vertices
  464. Form the largest palindromic number using atmost two swaps
  465. Count number of increasing subsequences of size k
  466. Reverse a Doubly Linked List | Set-2
  467. First common element in two linked lists
  468. Find the size of largest subset of anagram words
  469. Sorting array of strings (or words) using Trie | Set-2 (Handling Duplicates)
  470. Number of ways to form a heap with n distinct integers
  471. Count subarrays with equal number of 1's and 0's
  472. Check whether a binary tree is a full binary tree or not | Iterative Approach
  473. Program for triangular patterns of alphabets
  474. Possible edges of a tree for given diameter, height and vertices
  475. Minimum difference between groups of size two
  476. Iterative searching in Binary Search Tree
  477. Value of k-th index of a series formed by append and insert MEX in middle
  478. Postorder traversal of Binary Tree without recursion and without stack
  479. Subsequence queries after removing substrings
  480. Reverse a Doubly Linked List | Set 4 (Swapping Data)
  481. Maximum occurring character in an input string | Set-2
  482. Find a string in lexicographic order which is in between given two strings
  483. Growable array based stack
  484. Max occurring divisor in an interval
  485. Java Program to find largest element in an array
  486. Latin alphabet cipher
  487. Median and Mode using Counting Sort
  488. Minimum array element changes to make its elements 1 to N
  489. Insertion Sort by Swapping Elements
  490. Convert string X to an anagram of string Y with minimum replacements
  491. Reduce Hamming distance by swapping two characters
  492. Find the Degree of a Particular vertex in a Graph
  493. Find number of pairs in an array such that their XOR is 0
  494. Water Connection Problem
  495. Count maximum-length palindromes in a String
  496. Lexicographical concatenation of all substrings of a string
  497. Stable sort for descending order
  498. Sum of the alphabetical values of the characters of a string
  499. Balanced expressions such that given positions have opening brackets
  500. Height of a generic tree from parent array
  501. Print alternate nodes of a linked list using recursion
  502. Maximum number of trailing zeros in the product of the subsets of size k
  503. Linked List Pair Sum
  504. Print the alternate nodes of linked list (Iterative Method)
  505. Alternate Odd and Even Nodes in a Singly Linked List
  506. Count pairs from two sorted matrices with given sum
  507. Consecutive sequenced numbers in a string
  508. Modify a binary tree to get preorder traversal using right pointers only
  509. N Queen in O(n) space
  510. HCF of array of fractions (or rational numbers)
  511. Iterative program to Calculate Size of a tree
  512. Non-Repeating Element
  513. Insertion sort to sort even and odd positioned elements in different orders
  514. Sum of products of all combination taken (1 to n) at a time
  515. Row-wise vs column-wise traversal of matrix
  516. Top three elements in binary tree
  517. Maximum occurring character in a linked list
  518. Time taken by Loop unrolling vs Normal loop
  519. Check whether bits are in alternate pattern in the given range | Set-2
  520. Primality Test | Set 5(Using Lucas-Lehmer Series)
  521. Longest Path with Same Values in a Binary Tree
  522. Sum of maximum elements of all possible sub-arrays of an array
  523. Convert String into Binary Sequence
  524. Find common elements in three linked lists
  525. Insertion in Unrolled Linked List
  526. Find the only repetitive element between 1 to n-1
  527. Function to copy string (Iterative and Recursive)
  528. Check if any valid sequence is divisible by M
  529. Rank of an element in a stream
  530. Check if two strings are permutation of each other
  531. Number of recycled pairs in an array
  532. Schedule jobs so that each server gets equal load
  533. Find one extra character in a string
  534. Get maximum left node in binary tree
  535. Delete array elements which are smaller than next or become smaller
  536. Largest subset with maximum difference as 1
  537. Number of subarrays with m odd numbers
  538. Maximum Perimeter Triangle from array
  539. Rat in a Maze with multiple steps or jump allowed
  540. Minimal moves to form a string by adding characters or appending string itself
  541. Maximum Subarray Sum Excluding Certain Elements
  542. Count subarrays with same even and odd elements
  543. Count substrings with each character occurring at most k times
  544. Find unique elements in linked list
  545. Array range queries for searching an element
  546. Check if two people starting from different points ever meet
  547. K'th Largest element in BST using constant extra space
  548. Level order traversal with direction change after every two levels
  549. Find the Largest Cube formed by Deleting minimum Digits from a number
  550. Count numbers formed by given two digit with sum having given digits
  551. Hill Cipher
  552. Two Dimensional Segment Tree | Sub-Matrix Sum
  553. Arithmetic Number
  554. Making elements of two arrays same with minimum increment/decrement
  555. Lexicographical Maximum substring of string
  556. Program for Gauss-Jordan Elimination Method
  557. Print BST keys in given Range | O(1) Space
  558. Maximum in an array that can make another array sorted
  559. Program to reverse a string (Iterative and Recursive)
  560. Maximum adjacent difference in an array in its sorted form
  561. Lexicographically Kth smallest way to reach given coordinate from origin
  562. Ways to choose three points with distance between the most distant points <= L
  563. Count pairs with set bits sum equal to K
  564. Reverse String according to the number of words
  565. Postorder successor of a Node in Binary Tree
  566. System of Linear Equations in three variables using Cramer's Rule
  567. Maximum product quadruple (sub-sequence of size 4) in array
  568. Largest set with bitwise OR equal to n
  569. Partition negative and positive without comparison with 0
  570. Add n binary strings
  571. Subtract 1 without arithmetic operators
  572. Find the only element that appears b times
  573. Longest arithmetic progression with the given common difference
  574. Longest subarray such that adjacent elements have at least one common digit | Set 1
  575. Print concentric rectangular pattern in a 2d matrix
  576. Multiset Equivalence Problem
  577. Reverse nodes of a linked list without affecting the special characters
  578. Vieta's Formulas
  579. Infix to Prefix conversion using two stacks
  580. Queries for number of array elements in a range with Kth Bit Set
  581. Find the number of operations required to make all array elements Equal
  582. Sum of multiplication of triplet of divisors of a number
  583. Move first element to end of a given Linked List
  584. Recursive program to generate power set
  585. BigInteger andNot() Method in Java
  586. Repeated Character Whose First Appearance is Leftmost
  587. Delete leaf nodes with value k
  588. Duplicates in an array in O(n) time and by using O(1) extra space | Set-3
  589. Minimum number of prefix reversals to sort permutation of first N numbers
  590. Number of permutations such that sum of elements at odd index and even index are equal
  591. Print all distinct integers that can be formed by K numbers from a given array of N numbers
  592. kth smallest/largest in a small range unsorted array
  593. Number of sequences which has HEAD at alternate positions to the right of the first HEAD
  594. Sum of K largest elements in BST using O(1) Extra space
  595. Rearrange a Linked List in Zig-Zag fashion | Set-2
  596. nth Rational number in Calkin-Wilf sequence
  597. Number of Larger Elements on right side in a string
  598. Count number of steps to cover a distance if steps can be taken in powers of 2
  599. Permutation of a string with maximum number of characters greater than its adjacent characters
  600. Minimum element left from the array after performing given operations
  601. Check if concatenation of two strings is balanced or not
  602. Count of elements of an array present in every row of NxM matrix
  603. Longest Common Prefix Matching | Set-6
  604. Sort an array where a subarray of a sorted array is in reverse order
  605. Sudo Placement[1.3] | Playing with Stacks
  606. Sudo Placement[1.3] | Final Destination
  607. Implement a stack using singly linked list
  608. Check if a number has same number of set and unset bits
  609. Merge first half and reversed second half of the linked list alternatively
  610. Sum of all maximum frequency elements in Matrix
  611. Sum of all odd frequency elements in a Matrix
  612. Longest Common Subsequence | DP using Memoization
  613. Edit distance and LCS (Longest Common Subsequence)
  614. Find index of first occurrence when an unsorted array is sorted
  615. Elements of first array that have more frequencies
  616. Merge Sort with O(1) extra space merge and O(n lg n) time
  617. Sudo Placement[1.5] | Wolfish
  618. Absolute difference between the first X and last X Digits of N
  619. Floor in Binary Search Tree (BST)
  620. Average of ASCII values of characters of a given string
  621. Find the multiple of x which is closest to a^b
  622. Number of elements smaller than root using preorder traversal of a BST
  623. Check if all array elements are distinct
  624. Sort first half in ascending and second half in descending order | Set 2
  625. Print all the pairs that contains the positive and negative values of an element
  626. Longest substring with count of 1s more than 0s
  627. Minimum length of jumps to avoid given array of obstacles
  628. Shortest distance between two nodes in an infinite binary tree
  629. Find indices of all occurrence of one string in other
  630. Time difference between expected time and given time
  631. Minimize the difference between minimum and maximum elements
  632. Maximum value of XOR among all triplets of an array
  633. Flatten a binary tree into linked list | Set-2
  634. Delete array element in given index range [L - R]
  635. Next Smaller Element
  636. Counting frequencies of array elements
  637. Difference between fundamental data types and derived data types
  638. Number of divisors of product of N numbers
  639. Lowest Common Ancestor in Parent Array Representation
  640. Find the maximum node at a given level in a binary tree
  641. Balanced expressions such that given positions have opening brackets | Set 2
  642. Check if Queue Elements are pairwise consecutive
  643. Modulo power for large numbers represented as strings
  644. Root to leaf path sum equal to a given number in BST
  645. Preorder from Inorder and Postorder traversals
  646. FIFO (First-In-First-Out) approach in Programming
  647. Program to count number of distinct Squares and Cubes upto N
  648. Count number of primes in an array
  649. Count ways to reach a score using 1 and 2 with no consecutive 2s
  650. Lexicographically smallest permutation of a string with given subsequences
  651. Program to find sum of the given sequence
  652. Sum of the nodes of a Singly Linked List
  653. Program to invert bits of a number Efficiently
  654. Solve the Logical Expression given by string
  655. Total character pairs from two strings, with equal number of set bits in their ascii value
  656. Find all angles of a triangle in 3D
  657. Longest dividing subsequence
  658. Balance a string after removing extra brackets
  659. Search an Element in Doubly Circular Linked List
  660. Maximize the product of four factors of a Number
  661. Find a palindromic string B such that given String A is a subsequense of B
  662. Check if given string can be formed by two other strings or their permutations
  663. Delete every Kth node from circular linked list
  664. Program to Find the value of cos(nΘ)
  665. Print the number of set bits in each node of a Binary Tree
  666. Minimum and Maximum prime numbers in an array
  667. Sum and Product of all Prime Nodes of a Singly Linked List
  668. Count Unary Numbers in a Range
  669. Divide an array into K subarray with the given condition
  670. Find the winner of the Game to Win by erasing any two consecutive similar alphabets
  671. Find number of magical pairs of string of length L
  672. Generating numbers that are divisor of their right-rotations
  673. Numbers less than N which are product of exactly two distinct prime numbers
  674. Ways to write N as sum of two or more positive integers | Set-2
  675. Find the Second Largest Element in a Linked List
  676. Check if two Linked Lists are permutations of each other
  677. Program to calculate the value of nCr Efficiently
  678. Understanding The Coin Change Problem With Dynamic Programming
  679. Find column with maximum sum in a Matrix
  680. Find row with maximum sum in a Matrix
  681. Find the largest good number in the divisors of given number N
  682. How to access elements of a Square Matrix
  683. Insert a node in Binary Search Tree Iteratively
  684. Meta Binary Search | One-Sided Binary Search
  685. Find Sum of pair from two arrays with maximum sum
  686. Sum of all the prime numbers in a given range
  687. Check whether the given number is Euclid Number or not
  688. Pair of prime numbers with a given sum and minimum absolute difference
  689. Delete all the even nodes of a Circular Linked List
  690. Find the product of last N nodes of the given Linked List
  691. Program to print Spiral Pattern
  692. Product of all leaf nodes of binary tree
  693. Sum of Fibonacci Numbers with alternate negatives
  694. Print Sum and Product of all Non-Leaf nodes in Binary Tree
  695. Product of non-repeating (distinct) elements in an Array
  696. Product of all prime numbers in an Array
  697. Program to replace every space in a string with hyphen
  698. Check if suffix and prefix of a string are palindromes
  699. Minimum number of nodes in an AVL Tree with given height
  700. Product of the alternate nodes of linked list
  701. Sum of the alternate nodes of linked list
  702. Kth prime number greater than N
  703. Find the longest common prefix between two strings after performing swaps on second string
  704. Find the common nodes in two singly linked list
  705. Remove even frequency characters from the string
  706. Sum of Fibonacci numbers at even indexes upto N terms
  707. Sub-strings having exactly k characters that have ASCII value greater than p
  708. Count triplets in a sorted doubly linked list whose product is equal to a given value x
  709. Sort prime numbers of an array in descending order
  710. Maximize the sum of array by multiplying prefix of array with -1
  711. Count the numbers < N which have equal number of divisors as K
  712. Check if all the palindromic sub-strings are of odd length
  713. Reduce the string by removing K consecutive identical characters
  714. Linked List Product of Nodes Between 0s
  715. Lexicographically largest string formed from the characters in range L and R
  716. Search in a sorted 2D matrix (Stored in row major order)
  717. How to Remove Duplicates from ArrayList in Java
  718. Print all nodes between two given levels in Binary Tree
  719. Check whether bitwise OR of N numbers is Even or Odd
  720. Remove characters from string that appears strictly less than K times
  721. Replace all occurrences of pi with 3.14 in a given string
  722. Find length of longest Fibonacci like subsequence
  723. Maximum number of Unique integers in Sub-Array of given size
  724. Get K-th letter of the decoded string formed by repeating substrings
  725. Find the smallest after deleting given elements
  726. String after processing backspace characters
  727. Replace every elements in the array by its frequency in the array
  728. Number of leading zeros in binary representation of a given number
  729. Maximizing the elements with a[i+1] > a[i]
  730. Find array elements with frequencies in range [l , r]
  731. Remove elements from the array whose frequency lies in the range [l, r]
  732. Assign other value to a variable from two possible values
  733. Longest subarray in which all elements are greater than K
  734. Problem of 8 Neighbours of an element in a 2-D Matrix
  735. Check whether a number has consecutive 0's in the given base or not
  736. Find subsequences with maximum Bitwise AND and Bitwise OR
  737. Replace consonants with next immediate consonants alphabetically in a String
  738. Convert all lowercase characters to uppercase whose ASCII value is co-prime with k
  739. Replace all consonants with nearest vowels in a string
  740. Array elements with prime frequencies
  741. Sum and Product of all the nodes which are less than K in the linked list
  742. Number of ways to partition a string into two balanced subsequences
  743. Count subarrays with all elements greater than K
  744. Count and Sum of composite elements in an array
  745. Lexicographically smallest string formed by removing at most one character
  746. Maximum number of contiguous array elements with same number of set bits
  747. Print nodes of linked list at given indexes
  748. Check whether it is possible to make both arrays equal by modifying a single element
  749. Count of Prime Nodes of a Singly Linked List
  750. Find maximum distance between any city and station
  751. Program to find Prime Numbers Between given Interval
  752. Sum and Product of all Composite numbers which are divisible by k in an array
  753. Check whether all the rotations of a given number is greater than or equal to the given number or not
  754. Sum of every K’th prime number in an array
  755. Check whether frequency of characters in a string makes Fibonacci Sequence
  756. Product of all the Composite Numbers in an array
  757. Program to find the smallest element among three elements
  758. XOR of Prime Frequencies of Characters in a String
  759. Longest subarray with elements having equal modulo K
  760. Count occurrences of the average of array elements with a given number
  761. Number of sub-arrays that have at least one duplicate
  762. Minimum number of elements to be removed so that pairwise consecutive elements are same
  763. Rearrange a string in the form of integer sum followed by the minimized character
  764. Multiplication of two polynomials using Linked list
  765. Find if array has an element whose value is half of array sum
  766. Sort elements of array whose modulo with K yields P
  767. Array implementation of queue (Simple)
  768. Paths with maximum number of 'a' from (1, 1) to (X, Y) vertically or horizontally
  769. Difference between a Static Queue and a Singly Linked List
  770. Print all numbers less than N with at-most 2 unique digits
  771. Check whether count of distinct characters in a string is Prime or not
  772. Search a node in Binary Tree
  773. Largest right circular cone that can be inscribed within a sphere
  774. Largest cube that can be inscribed within a right circular cone
  775. Find all numbers that divide maximum array elements
  776. Generate a sequence with the given operations
  777. Check if the array has an element which is equal to product of remaining elements
  778. Sort perfect squares in an array at their relative positions
  779. Common prime factors of two numbers
  780. Total number of subsets in which the product of the elements is even
  781. Largest cube that can be inscribed within a right circular cylinder
  782. Count pairs with Bitwise XOR as EVEN number
  783. Minimum element of each row and each column in a matrix
  784. Program to convert the diagonal elements of the matrix to 0
  785. Find largest number smaller than N with same set of digits
  786. Sum of elements in an array having prime frequency
  787. Final string after performing given operations
  788. Sum of elements whose square root is present in the array
  789. Level Order Successor of a node in Binary Tree
  790. Find smallest and largest element from square matrix diagonals
  791. Minimum number of moves to make all elements equal
  792. Second Chance (or Clock) Page Replacement Policy
  793. Find the largest interval that contains exactly one of the given N integers.
  794. Find alphabet in a Matrix which has maximum number of stars around it
  795. Time taken by two persons to meet on a circular track
  796. Delete all Non-Prime Nodes from a Singly Linked List
  797. Rearrange all elements of array which are multiples of x in decreasing order
  798. Sum of Bitwise-OR of all subarrays of a given Array | Set 2
  799. Number of sub-strings which are anagram of any sub-string of another string
  800. Find maximum among all right nodes in Binary Tree
  801. Ceiling of every element in same array
  802. Digits of element wise sum of two arrays into a new array
  803. Number of Paths of Weight W in a K-ary tree
  804. Sum of elements in an array with frequencies greater than or equal to that element
  805. Find a sub matrix with maximum XOR
  806. Sort the array in a given index range
  807. Find k-th character of decrypted string | Set - 2
  808. Remove all continuous occurrences of 'a' and all occurrences of 'b'
  809. Count numbers upto N which are both perfect square and perfect cube
  810. Subtraction in the Array
  811. Average of remaining elements after removing K largest and K smallest elements from array
  812. Count the number of special permutations
  813. Substring Reverse Pattern
  814. Largest palindromic prime in an array
  815. Sum of elements from an array having even parity
  816. Check if the string satisfies the given condition
  817. Flatten a binary tree into linked list | Set-3
  818. Count of numbers which can be made power of 2 by given operation
  819. Count of Numbers in Range where first digit is equal to last digit of the number
  820. Minimum number of operations required to sum to binary string S
  821. Split a string in equal parts such that all parts are palindromes
  822. Number of array elements derivable from D after performing certain operations
  823. Print first N terms of series (0.25, 0.5, 0.75, ...) in fraction representation
  824. Minimize the maximum minimum difference after one removal from array
  825. Count distinct substrings that contain some characters at most k times
  826. Length of Diagonal of a n-sided regular polygon
  827. Count number of pairs (i, j) such that arr[i] * arr[j] > arr[i] + arr[j]
  828. Minimum absolute difference between N and a power of 2
  829. Finding in and out degrees of all vertices in a graph
  830. Maximum value of arr[i] % arr[j] for a given array
  831. Generate permutation of 1 to N such that absolute difference of consecutive numbers give K distinct integers
  832. Smallest multiple of 3 which consists of three given non-zero digits
  833. Ways to paint N paintings such that adjacent paintings don't have same colors
  834. Check if a number can be expressed as sum two abundant numbers
  835. Ternary Search
  836. Find nth term of the series 5 2 13 41
  837. Find Pth term of a GP if Mth and Nth terms are given
  838. Count distinct elements in an array
  839. Replace each node with its Surpasser Count in Linked List
  840. Program to check if a number is divisible by any of its digits
  841. Generate lexicographically smallest string of 0, 1 and 2 with adjacent swaps allowed
  842. Check if a number can be represented as a sum of 2 triangular numbers
  843. Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
  844. Make Binary Search Tree
  845. Minimum replacements to make adjacent characters unequal in a ternary string
  846. Minimum replacements such that the difference between the index of the same characters is divisible by 3
  847. Form lexicographically smallest string with minimum replacements having equal number of 0s, 1s and 2s
  848. Modify the string by swapping continuous vowels or consonants
  849. Maximize the subarray sum after multiplying all elements of any subarray with X
  850. Maximize the value of x + y + z such that ax + by + cz = n
  851. Maximum money that can be withdrawn in two steps
  852. Number of sub-strings that contain the given character exactly k times
  853. Maximum size of sub-array that satisfies the given condition
  854. Lexicographically largest sub-sequence of the given string
  855. Iterative Method To Print Left View of a Binary Tree
  856. Count triplet pairs (A, B, C) of points in 2-D space that satisfy the given condition
  857. Find the integers that doesnot ends with T1 or T2 when squared and added X
  858. Sum of minimum elements of all possible sub-arrays of an array
  859. Find the number of points that have atleast 1 point above, below, left or right of it
  860. Find sub-matrix with the given sum
  861. Number of strings that satisfy the given condition
  862. Print Leaf Nodes at a given Level
  863. Program to implement Run Length Encoding using Linked Lists
  864. Check whether the point (x, y) lies on a given line
  865. Generate a random permutation of elements from range [L, R] (Divide and Conquer)
  866. Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
  867. Minimize the sum of the squares of the sum of elements of each group the array is divided into
  868. Delete nodes which have a greater value on right side using recursion
  869. Program to construct a DFA which accept the language L = {anbm | n mod 2=0, m≥1}
  870. Search element in a Spirally sorted Matrix
  871. Count of numbers between range having only non-zero digits whose sum of digits is N and number is divisible by M
  872. Minimum removals to make array sum odd
  873. Maximum Bitwise AND pair from given range
  874. Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
  875. Count array elements that divide the sum of all other elements
  876. Longest sub-sequence of array containing Lucas numbers
  877. Find Nth positive number whose digital root is X
  878. Bitwise AND of N binary strings
  879. Number of trailing zeroes in base B representation of N!
  880. Sum of minimum element of all subarrays of a sorted array
  881. k-th missing element in an unsorted array
  882. Count all elements in the array which appears at least K times after their first occurrence
  883. Two equal sum segment range queries
  884. Character pairs from two strings with even sum
  885. Minimum matches the team needs to win to qualify
  886. Minimum cost to make a string free of a subsequence
  887. Given number of matches played, find number of teams in tournament
  888. Find Nth term of the series 1, 6, 18, 40, 75, ....
  889. Find Nth term of the series 1, 5, 32, 288 ...
  890. Longest double string from a Palindrome
  891. Minimum sum path between two leaves of a binary tree
  892. Maximize the summation of numbers in a maximum of K moves in range [L, R]
  893. Print all the sum pairs which occur maximum number of times
  894. Print the last k nodes of the linked list in reverse order | Iterative Approaches
  895. Sum of the series (1*2) + (2*3) + (3*4) + ...... upto n terms
  896. Count of a, b & c after n seconds for given reproduction rate
  897. Smallest integer > 1 which divides every element of the given array
  898. Encrypt a string by repeating i-th character i times
  899. Maximum number that can be display on Seven Segment Display using N segments
  900. Sum of (maximum element - minimum element) for all the subsets of an array.
  901. Minimum steps to make all the elements of the array divisible by 4
  902. Distinct state codes that appear in a string as contiguous sub-strings
  903. Find sum of a[i]%a[j] for all valid pairs
  904. Print leaf nodes in binary tree from left to right using one stack
  905. Reverse Anti Clockwise Spiral Traversal of a Binary Tree
  906. Count of numbers from range [L, R] whose sum of digits is Y
  907. Program to Encrypt a String using ! and @
  908. Last digit of Product of two Large or Small numbers (a * b)
  909. Count how many times the given digital clock shows identical digits
  910. Minimum cuts required to convert a palindromic string to a different palindromic string
  911. Count maximum elements of an array whose absolute difference does not exceed K
  912. First string from the given array whose reverse is also present in the same array
  913. Count of pairs from 1 to a and 1 to b whose sum is divisible by N
  914. Minimum changes required such that the string satisfies the given condition
  915. Check if Matrix remains unchanged after row reversals
  916. Smallest and Largest N-digit perfect squares
  917. Find if the given number is present in the infinite sequence or not
  918. Generate all the binary strings of N bits
  919. Maximum trace possible for any sub-matrix of the given matrix
  920. Minimum value among AND of elements of every subset of an array
  921. Check if the given array can be reduced to zeros with the given operation performed given number of times
  922. Count sub-arrays whose product is divisible by k
  923. Minimum steps to delete a string by deleting substring comprising of same characters
  924. Maximum sum from three arrays such that picking elements consecutively from same is not allowed
  925. Find a distinct pair (x, y) in given range such that x divides y
  926. Number of ways of scoring R runs in B balls with at most W wickets
  927. Programs for printing pyramid patterns using recursion
  928. Loss when two items are sold at same price and same percentage profit/loss
  929. Sum of Fibonacci Numbers in a range
  930. Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
  931. Maximum volume of cube for every person when edge of N cubes are given
  932. Determine the number of squares of unit area that a given line will pass through.
  933. Count nodes with two children at level L in a Binary Tree
  934. Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
  935. Sum of degrees of all nodes of a undirected graph
  936. Replace array elements by sum of next two consecutive elements
  937. Count the number of non-increasing subarrays
  938. Print all leaf nodes of a binary tree from right to left
  939. Pairs of strings which on concatenating contains each character of "string"
  940. Generate original array from difference between every two consecutive elements
  941. Generate all binary strings of length n with sub-string "01" appearing exactly twice
  942. Length of the longest substring that do not contain any palindrome
  943. Minimum steps to color the tree with given colors
  944. Find the final radiations of each Radiated Stations
  945. Find original numbers from gcd() every pair
  946. Count the number of pairs (i, j) such that either arr[i] is divisible by arr[j] or arr[j] is divisible by arr[i]
  947. Maximum number of people that can be killed with strength P
  948. Sum of the series Kn + ( K(n-1) * (K-1)1 ) + ( K(n-2) * (K-1)2 ) + ....... (K-1)n
  949. Find the number of binary strings of length N with at least 3 consecutive 1s
  950. Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors
  951. Reduce the fraction to its lowest form
  952. Lazy Propagation in Segment Tree | Set 2
  953. Shell-Metzner Sort
  954. Check if two strings are same ignoring their cases
  955. Find the number of sub arrays in the permutation of first N natural numbers such that their median is M
  956. Sum of all the levels in a Binary Search Tree
  957. Check if matrix A can be converted to B by changing parity of corner elements of any submatrix
  958. Length of the normal from origin on a straight line whose intercepts are given
  959. Number of subsequences with zero sum
  960. Find the maximum possible value of a[i] % a[j] over all pairs of i and j
  961. Maximize the maximum subarray sum after removing atmost one element
  962. Sum of elements in 1st array such that number of elements less than or equal to them in 2nd array is maximum
  963. Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
  964. Count different numbers possible using all the digits their frequency times
  965. Remove all occurrences of any element for maximum array sum
  966. Print all numbers whose set of prime factors is a subset of the set of the prime factors of X
  967. Highest power of a number that divides other number
  968. Sum of the series 1, 2, 4, 3, 5, 7, 9, 6, 8, 10, 11, 13.. till N-th term
  969. Reverse alternate k characters in a string
  970. Count of sub-strings that contain character X at least once
  971. Check if given two straight lines are identical or not
  972. Minimum cost to modify a string
  973. Find the position of box which occupies the given ball
  974. Check if string can be made lexicographically smaller by reversing any substring
  975. Find sum of factorials in an array
  976. Find the Diameter or Longest chord of a Circle
  977. Number of character corrections in the given strings to make them equal
  978. Maximum length of subarray such that sum of the subarray is even
  979. Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
  980. Sum of all parent-child differences in a Binary Tree
  981. Shortest distance from the centre of a circle to a chord
  982. Radius of the circle when the width and height of an arc is given
  983. Length of direct common tangent between the two non-intersecting Circles
  984. Length of direct common tangent between two intersecting Circles
  985. Shortest distance between a point and a circle
  986. Print even positioned nodes of even levels in level order of the given binary tree
  987. Count pairs with average present in the same array
  988. Minimizing array sum by applying XOR operation on all elements of the array
  989. Count unique numbers that can be generated from N by adding one and removing trailing zeros
  990. Minimum number of cubes whose sum equals to given number N
  991. Rat and Poisoned bottle Problem
  992. Longest alternative parity subsequence
  993. Number of positions such that adding K to the element is greater than sum of all other elements
  994. Largest even number that can be formed by any number of swaps
  995. Find the largest Perfect Subtree in a given Binary Tree
  996. Iterative Postorder traversal | Set 3
  997. Check if the robot is within the bounds of the grid after given moves
  998. Convert Directed Graph into a Tree
  999. Make lexicographically smallest palindrome by substituting missing characters
  1000. Count number of subsets whose median is also present in the same subset
  1001. Bellman Ford Algorithm (Simple Implementation)
  1002. Choose X such that (A xor X) + (B xor X) is minimized
  1003. Print characters having odd frequencies in order of occurrence
  1004. Ratio of the distance between the centers of the circles and the point of intersection of two direct common tangents to the circles
  1005. Minimum integer such that it leaves a remainder 1 on dividing with any element from the range [2, N]
  1006. Minimum operations required to change the array such that |arr[i] - M| <= 1
  1007. Minimum number of given operations required to reduce the array to 0 element
  1008. Program to find the rate percentage from compound interest of consecutive years
  1009. Find prime number K in an array such that (A[i] % K) is maximum
  1010. K-th ancestor of a node in Binary Tree | Set 3
  1011. Delete all even elements from a stack
  1012. Minimum sum obtained from groups of four elements from the given array
  1013. Count squares with odd side length in Chessboard
  1014. Check if the number is valid when flipped upside down
  1015. Minimum number of sub-strings of a string such that all are power of 5
  1016. Bitwise AND of sub-array closest to K
  1017. Find letter's position in Alphabet using Bit operation
  1018. Create new linked list from two given linked list with greater element at each node
  1019. Number of trees whose sum of degrees of all the vertices is L
  1020. Queries for bitwise OR in the index range [L, R] of the given array
  1021. Find the last non repeating character in string
  1022. Generate all unique partitions of an integer | Set 2
  1023. Check if the given Prufer sequence is valid or not
  1024. Print an N x M matrix such that each row and column has all the vowels in it
  1025. Find N distinct numbers whose bitwise Or is equal to K
  1026. Count the nodes of the given tree whose weighted string is a palindrome
  1027. Count the nodes of the tree whose weighted string contains a vowel
  1028. Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
  1029. Factorial of an Array of integers
  1030. Find the permutation p from the array q such that q[i] = p[i+1] - p[i]
  1031. Print the degree of every node from the given Prufer sequence
  1032. Distance between centers of two intersecting circles if the radii and common chord length is given
  1033. Print the node with the maximum degree in the prufer sequence
  1034. Count duplicates in a given linked list
  1035. Find the largest possible k-multiple set
  1036. Length of the perpendicular bisector of the line joining the centers of two circles
  1037. Find the number of Chicks in a Zoo at Nth day
  1038. Check if the two given stacks are same
  1039. Find the smallest positive number missing from an unsorted array : Hashing Implementation
  1040. Sum of XOR of all sub-arrays of length K
  1041. Length of the largest substring which have character with frequency greater than or equal to half of the substring
  1042. Count pairs of characters in a string whose ASCII value difference is K
  1043. Find a way to fill matrix with 1's and 0's in blank positions
  1044. Maximum distance between two unequal elements
  1045. Number of ways to split a binary number such that every part is divisible by 2
  1046. Count of adjacent Vowel Consonant Pairs
  1047. Gap Buffer Data Structure
  1048. Largest sub-string where all the characters appear at least K times
  1049. Construct the Rooted tree by using start and finish time of its DFS traversal
  1050. Run Length Decoding in Linked List
  1051. Find if a binary matrix exists with given row and column sums
  1052. Area of a Regular Pentagram
  1053. Create a Sorted Array Using Binary Search
  1054. Count Distinct Rectangles in N*N Chessboard
  1055. Number of sub-sequence such that it has one consecutive element with difference less than or equal to 1
  1056. Total number of odd length palindrome sub-sequence around each centre
  1057. Print Upper Hessenberg matrix of order N
  1058. Find the node with minimum value in a Binary Search Tree using recursion
  1059. Number of ways to get a given sum with n number of m-faced dices
  1060. Order of indices which is lexicographically smallest and sum of elements is <= X
  1061. Count pairs of elements such that number of set bits in their OR is B[i]
  1062. Add Two Numbers Represented by Linked Lists | Set 3
  1063. Minimum operations to make sum of neighbouring elements <= X
  1064. Queries for number of distinct elements from a given index till last index in an array
  1065. Maximum number of region in which N non-parallel lines can divide a plane
  1066. Kth smallest element in the array using constant space when array can't be modified
  1067. Print first N terms of Lower Wythoff sequence
  1068. Delete Nth node from the end of the given linked list
  1069. Number of possible permutations when absolute difference between number of elements to the right and left are given
  1070. Check whether str1 can be converted to str2 with the given operations
  1071. Number of elements from the array which are reachable after performing given operations on D
  1072. Find the minimum number of elements that should be removed to make an array good
  1073. Construct a DFA which accept the language L = {w | w ∈ {a,b}* and Na(w) mod 3 = Nb (w) mod 3}
  1074. Bitonic point in the given linked list
  1075. Construct a DFA which accept the language L = {anbm | n > =1, (m) mod 3 = 1}
  1076. Reverse a Linked List in groups of given size (Iterative Approach)
  1077. Smallest number greater or equals to N such that it has no odd positioned bit set
  1078. Find a subarray whose sum is divisible by size of the array
  1079. Pair with minimum absolute difference | BST
  1080. Add one to a number represented as linked list | Set 2
  1081. Find the number of paths of length K in a directed graph
  1082. Partiton the string in two parts such that both parts have at least k different characters
  1083. Sort an array without changing position of negative numbers
  1084. Find the position of the given row in a 2-D array
  1085. Unbounded Fractional Knapsack
  1086. Find Leftmost and Rightmost node of BST from its given preorder traversal
  1087. Find a partition point in array to maximize its xor sum
  1088. Check if the given n-ary tree is a binary tree
  1089. Length of longest subarray in which elements greater than K are more than elements not greater than K
  1090. Count of strings in the first array which are smaller than every string in the second array
  1091. Find distinct characters in distinct substrings of a string
  1092. Check if it is possible to redistribute the Array
  1093. Count of non-overlapping sub-strings "101" and "010" in the given binary string
  1094. Programs to print Triangle and Diamond patterns using recursion
  1095. Number of Quadruples with GCD equal to K
  1096. Decimal to Binary using recursion and without using power operator
  1097. Remove Minimum coins such that absolute difference between any two piles is less than K
  1098. Count total set bits in all numbers from 1 to n | Set 2
  1099. Maximum length palindromic substring such that it starts and ends with given char
  1100. Print the lexicographically smallest array by swapping elements whose sum is odd
  1101. Find the number of words of X vowels and Y consonants that can be formed from M vowels and N consonants
  1102. Distinct strings such that they contains given strings as sub-sequences
  1103. Case-specific sorting of Strings in O(n) time and O(1) space
  1104. Minimum Bitwise OR operations to make any two array elements equal
  1105. Partition the array in K segments such that bitwise AND of individual segment sum is maximized
  1106. Count ways to divide circle using N non-intersecting chord | Set-2
  1107. Count equal pairs from given string arrays
  1108. Check if a number is Fermat Pseudoprime
  1109. Find k ordered pairs in array with minimum difference d
  1110. Maximum length sub-array which satisfies the given conditions
  1111. Program to Find the Incenter of a Triangle
  1112. Divide the array in K segments such that the sum of minimums is maximized
  1113. Find array such that no subarray has xor zero or Y
  1114. Sum of the Tan(x) expansion upto N terms
  1115. Find the number of occurrences of a character upto preceding position
  1116. Count of elements that can be deleted without disturbing the mean of the initial array
  1117. Find prime numbers in the first half and second half of an array
  1118. Minimum number of times A has to be repeated such that B is a substring of it
  1119. Euler zigzag numbers ( Alternating Permutation )
  1120. Find smallest positive number Y such that Bitwise AND of X and Y is Zero
  1121. Square root of a number without using sqrt() function
  1122. Program for sum of cosh(x) series upto Nth term
  1123. Modular Exponentiation of Complex Numbers
  1124. Check if the product of every contiguous subsequence is different or not in a number
  1125. Find the kth smallest number with sum of digits as m
  1126. Rearrange the characters of the string such that no two adjacent characters are consecutive English alphabets
  1127. Ramanujan Prime
  1128. Quadruplet pair with XOR zero in the given Array
  1129. Maximum Bitwise AND value of subsequence of length K
  1130. Largest substring with same Characters
  1131. Sum of prime numbers without odd prime digits
  1132. Maximum number of elements without overlapping in a Line
  1133. Remove Nth node from end of the Linked List
  1134. FCFS Disk Scheduling Algorithms
  1135. Sum of the sums of all possible subsets
  1136. Find the number of cells in the table contains X
  1137. How to learn Pattern printing easily?
  1138. Find the smallest positive number missing from an unsorted array | Set 3
  1139. Check whether two points (x1, y1) and (x2, y2) lie on same side of a given line or not
  1140. Find the maximum sum of digits of the product of two numbers
  1141. Find the Deepest Node in a Binary Tree Using Queue STL - SET 2
  1142. Lexicographical smallest alternate Array
  1143. Equal Sum and XOR of three Numbers
  1144. Number of Subsequences with Even and Odd Sum
  1145. Count Set-bits of number using Recursion
  1146. Minimize the cost of buying the Objects
  1147. Sum of digits with even number of 1's in their binary representation
  1148. Remove duplicates from unsorted array using Set data structure
  1149. Find the smallest positive number which can not be represented by given digits
  1150. Sum of all natural numbers from L to R ( for large values of L and R )
  1151. Number of Subsequences with Even and Odd Sum | Set 2
  1152. Count all the permutation of an array
  1153. Find all numbers between range L to R such that sum of digit and sum of square of digit is prime
  1154. Minimum given operations required to convert a given binary string to all 1's
  1155. Reverse every word of the string except the first and the last character
  1156. First N terms whose sum of digits is a multiple of 10
  1157. Sand Timer Flip Counting Problem
  1158. Check if a number is Flavius Number
  1159. Swap Alternate Boundary Pairs
  1160. Probability such that two subset contains same number of elements
  1161. Sum of elements till the smallest index such that there are no even numbers to its right
  1162. Program to find the next prime number
  1163. Count the number of elements which are greater than any of element on right side of an array
  1164. Position of Elements which are equal to sum of all Preceding elements
  1165. Queries for rotation and Kth character of the given string in constant time
  1166. Number of substrings that start with "geeks" and end with "for"
  1167. Maximum XOR of Two Numbers in an Array
  1168. Delete the last leaf node in a Binary Tree
  1169. Find Kth element in an array containing odd elements first and then even elements
  1170. Nth Fibonacci number using Pell's equation
  1171. Area of the largest square that can be formed from the given length sticks using Hashing
  1172. Generate N integers satisfying the given conditions
  1173. Comparing X^Y and Y^X for very large values of X and Y
  1174. Largest substring of str2 which is a prefix of str1
  1175. Count the values greater than X in the modified array
  1176. Find permutation with maximum remainder Sum
  1177. Reverse the given string in the range [L, R]
  1178. Maximum OR value of a pair in an array
  1179. Print characters having even frequencies in order of occurrence
  1180. Queries for the smallest and the largest prime number of given digit
  1181. Count of numbers below N whose sum of prime divisors is K
  1182. Find the count of subsequences where each element is divisible by K
  1183. Generate an array having Bitwise AND of the previous and the next element
  1184. Count occurrences of a prime number in the prime factorization of every element from the given range
  1185. Make the list non-decreasing by changing only one digit of the elements
  1186. Replace elements with absolute difference of smallest element on left and largest element on right
  1187. Number of Subarrays with positive product
  1188. Find number of subarrays with XOR value a power of 2
  1189. Find the minimum capacity of the train required to hold the passengers
  1190. Find the sum of all possible pairs in an array of N elements
  1191. Find out the prime numbers in the form of A+nB or B+nA
  1192. Count of triples (A, B, C) where A*C is greater than B*B
  1193. Count the number of subsequences of length k having equal LCM and HCF
  1194. Contiguous unique substrings with the given length L
  1195. Count of subsets not containing adjacent elements
  1196. Sum of the digits of square of the given number which has only 1's as its digits
  1197. XOR of elements in an array having prime frequency
  1198. Queries to check whether all the elements in the given range occurs even number of times
  1199. Sum of squares of all Subsets of given Array
  1200. Array containing power of 2 whose XOR and Sum of elements equals X
  1201. Find third number such that sum of all three number becomes prime
  1202. Count of Multiples of A ,B or C less than or equal to N
  1203. Total ways of selecting a group of X men from N men with or without including a particular man
  1204. Find the number of strings formed using distinct characters of a given string
  1205. Nth number in a set of multiples of A , B or C
  1206. Check if all elements of binary array can be made 1
  1207. Find numbers which are multiples of first array and factors of second array
  1208. Find the possible permutation of the bits of N
  1209. Count of N-digit numbers in base K with no two consecutive zeroes
  1210. Largest sub-matrix with all equal elements
  1211. Print nodes having maximum and minimum degrees
  1212. QuickSelect (A Simple Iterative Implementation)
  1213. Find Partition Line such that sum of values on left and right is equal
  1214. Sum of Digits of the Good Strings
  1215. Minimum halls required for class scheduling
  1216. Find the count of natural Hexadecimal numbers of size N
  1217. Find a pair (n,r) in an integer array such that value of nCr is maximum
  1218. Maximize the expression (A AND X) * (B AND X) | Bit Manipulation
  1219. Minimum number of substrings the given string can be splitted into that satisfy the given conditions
  1220. Sum of numbers in a range [L, R] whose count of divisors is prime
  1221. Minimum number of additons to make the string balanced
  1222. Maximum number of line intersections formed through intersection of N planes
  1223. Program to find Nth odd Fibonacci Number
  1224. Count of N-bit binary numbers without leading zeros
  1225. Find the next fibonacci number
  1226. Find missing elements from an Array
  1227. Divide the array into minimum number of sub-arrays having unique elements
  1228. Find the minimum value of X for an expression
  1229. Minimum increment or decrement operations required to make the array sorted
  1230. Largest Even and Odd N-digit numbers in Octal Number System
  1231. Number of coloured 0's in an N-level hexagon
  1232. Program to print the Diagonals of a Matrix
  1233. Count number of ways to arrange first N numbers
  1234. Count non-adjacent subsets from numbers arranged in Circular fashion
  1235. Minimum, maximum and average price values for all the items of given type
  1236. Number of ways N can be divided into four parts to construct a rectangle
  1237. Length of the longest subsegment which is UpDown after inserting atmost one integer
  1238. Finding the converging element of the diagonals in a square matrix
  1239. Find the deleted value from the array when average of original elements is given
  1240. Probability that a random pair chosen from an array (a[i], a[j]) has the maximum sum
  1241. Count of matchsticks required to represent the given number
  1242. Number of K length subsequences with minimum sum
  1243. Maximum number of times str1 appears as a non-overlapping substring in str2
  1244. Number of subsets whose mean is maximum
  1245. Sum of all the numbers in the Nth parenthesis
  1246. Minimum numbers with one's place as 9 to be added to get N
  1247. Number of cells in the Nth order figure
  1248. Sum of all the numbers in the Nth row of the given triangle
  1249. Make the array non-decreasing with the given operation
  1250. Count of pairs in an array such that the highest power of 2 that divides their product is 1
  1251. Find the number of positive integers less than or equal to N that have an odd number of digits
  1252. Number of index pairs such that s[i] and s[j] are anagrams
  1253. Increasing permutation of first N natural numbers
  1254. Coxeter method to construct the magic square
  1255. Minimize sum by dividing all elements of a subarray by K
  1256. Count of integers obtained by replacing ? in the given string that give remainder 5 when divided by 13
  1257. Maximum sum of minimums of pairs in an array
  1258. Minimum number of moves to reach N starting from (1, 1)
  1259. Find the number of squares inside the given square grid
  1260. Count of subsets with sum equal to X
  1261. Count of squares that can be drawn without lifting the pencil
  1262. Number of subsets with a given AND value
  1263. Longest sub-sequence with minimum LCM
  1264. Number of subsets with a given OR value
  1265. Sum of subsets of all the subsets of an array | O(2^N)
  1266. Sum of subsets of all the subsets of an array | O(N)
  1267. Longest subsequence whose sum is divisible by a given number
  1268. Find all palindrome numbers of given digits
  1269. Number of non-decreasing sub-arrays of length less than or equal to K
  1270. Maximum number of splits of a binary number
  1271. Longest subsequence with a given AND value | O(N)
  1272. Check the divisibility of Hexadecimal numbers
  1273. Minimum difference between any two primes from the given range
  1274. Maximum prime moves to convert X to Y
  1275. Longest subsequence with a given OR value : Dynamic Programming Approach
  1276. Program for nth Fuss–Catalan Number
  1277. Rearrange array elements such that Bitwise AND of first N - 1 elements is equal to last element