princi singh
princi singh
princi singh hasn't contributed any 'Articles' yet!
You may use GeeksforGeeks CONTRIBUTE portal to help other geeks. For more info, please refer this.

  1. Remove duplicates from a given string
  2. Detect loop in a linked list
  3. Find the Number Occurring Odd Number of Times
  4. Queue using Stacks
  5. Maximum width of a binary tree
  6. Print a given matrix in spiral form
  7. N Queen Problem | Backtracking-3
  8. Pattern Searching | Set 6 (Efficient Construction of Finite Automata)
  9. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  10. Given a sequence of words, print all anagrams together | Set 1
  11. Implement Stack using Queues
  12. Largest Independent Set Problem | DP-26
  13. A Pancake Sorting Problem
  14. How to check if two given line segments intersect?
  15. Convex Hull | Set 1 (Jarvis's Algorithm or Wrapping)
  16. Reverse alternate levels of a perfect binary tree
  17. Function to find Number of customers who could not get a computer
  18. How to print maximum number of A's using given four keys
  19. Group multiple occurrence of array elements ordered by first occurrence
  20. Find the nearest smaller numbers on left side in an array
  21. Find sum of all elements in a matrix except the elements in row and/or column of given cell?
  22. Count distinct elements in every window of size k
  23. How to check if a given array represents a Binary Heap?
  24. Range Minimum Query (Square Root Decomposition and Sparse Table)
  25. Count number of paths with at-most k turns
  26. Form minimum number from given sequence
  27. Print maximum sum square sub-matrix of given size
  28. Repeated subsequence of length 2 or more
  29. Cuckoo Hashing - Worst case O(1) Lookup!
  30. Print Binary Tree in 2-Dimensions
  31. Print all words matching a pattern in CamelCase Notation Dictonary
  32. Rearrange array in alternating positive & negative items with O(1) extra space | Set 2
  33. Find frequency of each element in a limited range array in less than O(n) time
  34. Palindrome Substring Queries
  35. Maximize arr[j] - arr[i] + arr[l] - arr[k], such that i < j < k < l
  36. A Space Optimized DP solution for 0-1 Knapsack Problem
  37. Frequency Measuring Techniques for Competitive Programming
  38. Flip Binary Tree
  39. Remove Invalid Parentheses
  40. Maximum and Minimum Product Subsets
  41. Perfect reversible string
  42. Minimum Cost to cut a board into squares
  43. Maximum mirrors which can transfer light from bottom to right
  44. XOR Cipher
  45. Find maximum difference between nearest left and right smaller elements
  46. Partition of a set into K subsets with equal sum
  47. Minimum cost to sort strings using reversal operations of different costs
  48. Program to toggle all characters in a string
  49. Sublist Search (Search a linked list in another list)
  50. Find sum of divisors of all the divisors of a natural number
  51. Divide array into two sub-arrays such that their averages are equal
  52. Pairs of Amicable Numbers
  53. Type of array and its maximum element
  54. Program for FCFS CPU Scheduling | Set 2 (Processes with different arrival times)
  55. Find the Deepest Node in a Binary Tree
  56. Find the largest multiple of 3 from array of digits | Set 2 (In O(n) time and O(1) space)
  57. Recaman's sequence
  58. Count of arrays in which all adjacent elements are such that one of them divide the another
  59. Sorting Strings using Bubble Sort
  60. Print All Distinct Elements of a given integer array
  61. Program to find remainder without using modulo or % operator
  62. Check if given string can be split into four distinct strings
  63. Doolittle Algorithm : LU Decomposition
  64. Move spaces to front of string in single traversal
  65. Convert given time into words
  66. Alternate vowel and consonant string
  67. Count the number of ways to divide an array into three contiguous parts having equal sum
  68. Find shortest unique prefix for every word in a given list | Set 2 (Using Sorting)
  69. Insertion Sort for Doubly Linked List
  70. Shortest path between two nodes in array like representation of binary tree
  71. Recursive Selection Sort
  72. Program to find line passing through 2 Points
  73. Find the sum of last n nodes of the given Linked List
  74. Count pairs from two linked lists whose sum is equal to a given value
  75. Find the Sub-array with sum closest to 0
  76. Find the character in first string that is present at minimum index in second string
  77. Recursive selection sort for singly linked list | Swapping node links
  78. Print odd positioned nodes of odd levels in level order of the given binary tree
  79. Convert all substrings of length 'k' from base 'b' to decimal
  80. Check if the given string of words can be formed from words present in the dictionary
  81. Print nodes at k distance from root | Iterative
  82. Find All Duplicate Subtrees
  83. Program to Count numbers on fingers
  84. Check whether right angled triangle is valid or not for large sides
  85. Repeatedly search an element by doubling it after every successful search
  86. Shortest possible combination of two strings
  87. Count subarrays with equal number of occurrences of two given elements
  88. Interleave the first half of the queue with second half
  89. Sum and Product of Prime Frequencies of Characters in a String
  90. A sorting algorithm that slightly improves on selection sort
  91. Array range queries over range queries
  92. Difference between highest and least frequencies in an array
  93. Longest Repeated Subsequence
  94. Check if a two character string can be made using given words
  95. Longest increasing sublist in a linked list
  96. Secretary Problem (A Optimal Stopping Problem)
  97. Direction of a Point from a Line Segment
  98. Longest subarray having count of 1s one more than count of 0s
  99. Longest subsequence such that difference between adjacents is one | Set 2
  100. Program to sort string in descending order
  101. Longest subsequence of the form 0*1*0* in a binary string
  102. Root to leaf path with maximum distinct nodes
  103. Largest increasing subsequence of consecutive integers
  104. Binary tree to string with brackets
  105. Check whether a number can be represented by sum of two squares
  106. Pair with given sum and maximum shortest distance from end
  107. Last seen array element (last appearance is earliest)
  108. Frequency of a substring in a string
  109. Count of operations to make a binary string"ab" free
  110. Change string to a new character set
  111. Identify and mark unmatched parenthesis in an expression
  112. Count subarrays where second highest lie before highest
  113. Minimum cost to make Longest Common Subsequence of length k
  114. Print n smallest elements from given array in their original order
  115. Construct a graph from given degrees of all vertices
  116. Minimum number of points to be removed to get remaining points on one side of axis
  117. Print reverse of a Linked List without extra space and modifications
  118. Change the array into a permutation of numbers from 1 to n
  119. Reverse first K elements of given linked list
  120. Program for triangular patterns of alphabets
  121. Count of subsequences having maximum distinct elements
  122. Sorted merge of two sorted doubly circular linked lists
  123. Growable array based stack
  124. Deepest right leaf node in a binary tree | Iterative approach
  125. Level of Each node in a Tree from source node (using BFS)
  126. Insertion Sort by Swapping Elements
  127. Maximum rational number (or fraction) from an array
  128. Count maximum-length palindromes in a String
  129. Lexicographical concatenation of all substrings of a string
  130. Linked List Pair Sum
  131. Majority element in a linked list
  132. Sum of heights of all individual nodes in a binary tree
  133. Smallest value in each level of Binary Tree
  134. Find common elements in three linked lists
  135. Function to copy string (Iterative and Recursive)
  136. Find one extra character in a string
  137. Rat in a Maze with multiple steps or jump allowed
  138. Lexicographically next greater string using same character set
  139. Sum of nodes at maximum depth of a Binary Tree
  140. Disjoint Set Union on trees | Set 1
  141. Bitwise recursive addition of two integers
  142. Delete all Prime Nodes from a Singly Linked List
  143. Sum of cousins of a given node in a Binary Tree
  144. Program to reverse a string (Iterative and Recursive)
  145. Count number of pairs in array having sum divisible by K | SET 2
  146. Maximum length of a sub-array with ugly numbers
  147. Count pairs with set bits sum equal to K
  148. Find the only element that appears b times
  149. Smallest number in BST which is greater than or equal to N
  150. Check if array sum can be made K by three operations on it
  151. Find the lexicographical next balanced bracket sequence
  152. Print all pairs with given sum
  153. Repeated Character Whose First Appearance is Leftmost
  154. Print all triplets with given sum
  155. Inorder predecessor and successor for a given key in BST | Iterative Approach
  156. Check if two trees are mirror of each other using level order traversal
  157. Count occurrences of a substring recursively
  158. Reorder the given string to form a K-concatenated string
  159. Level order traversal with direction change after every two levels | Recursive Approach
  160. Square of large number represented as String
  161. Level order traversal in spiral form | Using one stack and one queue
  162. Print the nearest prime number formed by adding prime numbers to N
  163. Check if any permutation of a large number is divisible by 8
  164. Sum of all odd frequency elements in a Matrix
  165. Sorting without comparison of elements
  166. Shortest distance between two nodes in an infinite binary tree
  167. Weird Number
  168. Majority Element | Set-2 (Hashing)
  169. Program to print Sine-Wave Pattern
  170. Delete array element in given index range [L - R]
  171. Counting frequencies of array elements
  172. Find total number of distinct years from a string
  173. Find out the correct position of the ball after shuffling
  174. Find the largest after deleting the given elements
  175. Concatenate strings in any order to get Maximum Number of "AB"
  176. Maximum occurred integer in n ranges | Set-2
  177. Maximize the product of four factors of a Number
  178. Longest subarray having difference in the count of 1's and 0's equal to k
  179. Check if given string can be formed by two other strings or their permutations
  180. Find any pair with given GCD and LCM
  181. Program to Add Two Complex Numbers
  182. Minimum and Maximum Prime Numbers of a Singly Linked List
  183. Sort Linked List containing values from 1 to N
  184. Quotient - Remainder Sort
  185. Maximum element in min heap
  186. Find maximum in a stack in O(1) time and O(1) extra space
  187. Check whether the given number is Euclid Number or not
  188. Check whether it is possible to join two points given on circle such that distance between them is k
  189. Find the sum of all highest occurring elements in an Array
  190. Sum of all odd frequency elements in an array
  191. Iterative program to find distance of a node from root
  192. Product of non-repeating (distinct) elements in an Array
  193. Find the winner of the game with N piles of boxes
  194. Minimum number of nodes in an AVL Tree with given height
  195. Check if a number is a Trojan Number
  196. Root to leaf path product equal to a given number
  197. Find the smallest after deleting given elements
  198. Program to find count of numbers having odd number of divisors in given range
  199. Check whether a number has consecutive 0's in the given base or not
  200. Sorting array elements with set bits equal to K
  201. Count pairs in an array such that both elements has equal set bits
  202. Find if array has an element whose value is half of array sum
  203. In-Place Merge Sort
  204. Count pairs from two arrays whose modulo operation yields K
  205. Count distinct pairs from two arrays having same sum of digits
  206. Print path between any two nodes in a Binary Tree
  207. Find all numbers that divide maximum array elements
  208. Radii of the three tangent circles of equal radius which are inscribed within a circle of given radius
  209. Find the node whose absolute difference with X gives maximum value
  210. Find the largest interval that contains exactly one of the given N integers.
  211. Subtraction in the Array
  212. Check if the string satisfies the given condition
  213. Number of pairs whose sum is a power of 2
  214. Recursive program to insert a star between pair of identical characters
  215. Shortest root to leaf path sum equal to a given number
  216. Count rows in a matrix that consist of same element
  217. Number of ways to divide a Binary tree into two halves
  218. A variation of Rat in a Maze : multiple steps or jumps allowed
  219. Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
  220. Sum of all the Boundary Nodes of a Binary Tree
  221. Count triplet pairs (A, B, C) of points in 2-D space that satisfy the given condition
  222. Iterative Letter Combinations of a Phone Number
  223. Queries for number of distinct integers in Suffix
  224. Number of trailing zeroes in base B representation of N!
  225. Sum of minimum element of all sub-sequences of a sorted array
  226. Print the last k nodes of the linked list in reverse order | Iterative Approaches
  227. Sum of nodes in top view of binary tree
  228. Longest path in a directed Acyclic graph | Dynamic Programming
  229. Search an element in given N ranges
  230. Correct the Random Pointer in Doubly Linked List
  231. Find the hypotenuse of a right angled triangle with given two sides
  232. Generate all binary strings of length n with sub-string "01" appearing exactly twice
  233. Delete odd and even numbers at alternate step such that sum of remaining elements is minimized
  234. Minimum sub-array such that number of 1's in concatenation of binary representation of its elements is at least K
  235. Maximum length cycle that can be formed by joining two nodes of a binary tree
  236. Building Heap from Array
  237. Minimum value of X to make all array elements equal by either decreasing or increasing by X
  238. Find the largest Perfect Subtree in a given Binary Tree
  239. Minimum increments to convert to an array of consecutive integers
  240. Convert Directed Graph into a Tree
  241. Bellman Ford Algorithm (Simple Implementation)
  242. K-th ancestor of a node in Binary Tree | Set 3
  243. Create linked list from a given array
  244. Bitwise AND of sub-array closest to K
  245. Generate two BSTs from the given array such that maximum height among them is minimum
  246. Check if the given array contains all the divisors of some integer
  247. Check if the given matrix is increasing row and column wise
  248. Angle between a chord and a tangent when angle in the alternate segment is given
  249. Find a triplet in an array whose sum is closest to a given number
  250. Number of ways to divide an array into K equal sum sub-arrays
  251. Length of the chord the circle if length of the another chord which is equally inclined through the diameter is given
  252. Count duplicates in a given linked list
  253. Find the number of Chicks in a Zoo at Nth day
  254. Paths from entry to exit in matrix and maximum path sum
  255. Find the smallest positive number missing from an unsorted array : Hashing Implementation
  256. Count of three non-overlapping sub-strings which on concatenation forms a palindrome
  257. Maximise array sum after taking non-overlapping sub-arrays of length K
  258. Length of the largest substring which have character with frequency greater than or equal to half of the substring
  259. Check whether two strings contain same characters in same order
  260. Count pairs of elements such that number of set bits in their AND is B[i]
  261. Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
  262. Number of ways to choose elements from the array such that their average is K
  263. Find the element in the matrix generated by given rules
  264. Gap Buffer Data Structure
  265. Largest sub-string where all the characters appear at least K times
  266. Count of characters in str1 such that after deleting anyone of them str1 becomes str2
  267. Count common elements in two arrays containing multiples of N and M
  268. Print Bottom-Right View of a Binary Tree
  269. Find number of factors of N when location of its two factors whose product is N is given
  270. Rearrange characters in a string such that no two adjacent are same using hashing
  271. Find a sequence of N prime numbers whose sum is a composite number
  272. Number of possible permutations when absolute difference between number of elements to the right and left are given
  273. Number of triplets such that each value is less than N and each pair sum is a multiple of K
  274. Count numbers in given range such that sum of even digits is greater than sum of odd digits
  275. Sum of Semi-Prime Numbers less than or equal to N
  276. Maximum XOR with given value in the path from root to given node in the tree
  277. Nodes from given two BSTs with sum equal to X
  278. Flatten binary tree in order of post-order traversal
  279. Count substrings that contain all vowels | SET 2
  280. Number of ways of distributing N identical objects in R distinct groups
  281. Find the position of the given row in a 2-D array
  282. Distinct adjacent elements in a binary array
  283. 21 Matchsticks Problem
  284. Count of strings in the first array which are smaller than every string in the second array
  285. Programs to print Triangle and Diamond patterns using recursion
  286. Number of N length sequences whose product is M
  287. Number of Quadruples with GCD equal to K
  288. Count total set bits in all numbers from 1 to n | Set 2
  289. Maximum length palindromic substring such that it starts and ends with given char
  290. Generate all possible strings such that char at index i is either str1[i] or str2[i]
  291. Sort the Queue using Recursion
  292. Number of ways to arrange 2*N persons on the two sides of a table with X and Y persons on opposite sides
  293. Perimeter of an Ellipse
  294. XOR in a range of a binary array
  295. Swap all occurrences of two characters to get lexicographically smallest string
  296. Number of balanced parenthesis substrings
  297. Find maximum xor of k elements in an array
  298. Find the sum of the first half and second half elements of an array
  299. Maximum sum of the array after dividing it into three segments
  300. Time taken per hour for stoppage of Car
  301. Convert a String to an Integer using Recursion
  302. Find the difference of count of equal elements on the right and the left for each element
  303. Find prime numbers in the first half and second half of an array
  304. Smallest element greater than X not present in the array
  305. Check if the given string is vowel prime
  306. Square root of a number without using sqrt() function
  307. Alcuin's Sequence
  308. Wedderburn–Etherington number
  309. Subtraction of the alternate nodes of Linked List
  310. Find the final sequence of the array after performing given operations
  311. Find the kth smallest number with sum of digits as m
  312. Print all the peaks and troughs in an Array of Integers
  313. Queries to print the character that occurs the maximum number of times in a given range
  314. Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized
  315. Reduce number to a single digit by subtracting adjacent digits repeatedly
  316. Sum of prime numbers without odd prime digits
  317. Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
  318. Number of shortest paths to reach every cell from bottom-left cell in the grid
  319. How to learn Pattern printing easily?
  320. Find the maximum cost path from the bottom-left corner to the top-right corner
  321. Find the ln(X) and log10X with the help of expansion
  322. Count number of ways to reach destination in a Maze using BFS
  323. Find the average of k digits from the beginning and l digits from the end of the given number
  324. Minimum operations required to convert a binary string to all 0s or all 1s
  325. Find the remaining balance after the transaction
  326. Count all the permutation of an array
  327. Count number of bits to be flipped to convert A to B | Set-2
  328. Minimum number of Fibonacci jumps to reach end
  329. Reversing a Queue using another Queue
  330. Nth XOR Fibonacci number
  331. Count of triplets that satisfy the given equation
  332. Position of Elements which are equal to sum of all Preceding elements
  333. Check if it is possible to perform the given Grid Division
  334. Minimum distance to visit all the nodes of an undirected weighted tree
  335. Maximum XOR of Two Numbers in an Array
  336. Area of the largest square that can be formed from the given length sticks using Hashing
  337. Maximum subsequence sum such that all elements are K distance apart
  338. Largest substring of str2 which is a prefix of str1
  339. Find a Square Matrix such that sum of elements in every row and column is K
  340. Print odd positioned nodes of even levels in level order of the given binary tree
  341. Calculate height of Binary Tree using Inorder and Level Order Traversal
  342. Print characters having even frequencies in order of occurrence
  343. Product of elements in an array having prime frequency
  344. Find the number on the card that remains in the end after performing the given operations
  345. Count total set bits in all numbers from 1 to N | Set 3
  346. Find the minimum capacity of the train required to hold the passengers
  347. Count of numbers in the range [L, R] which satisfy the given conditions
  348. Count of triples (A, B, C) where A*C is greater than B*B
  349. Count of subsets not containing adjacent elements
  350. Check if the rows of a binary matrix can be made unique by removing a single column
  351. Sum of the digits of square of the given number which has only 1's as its digits
  352. Minimum cost to make all array elements equal
  353. Array containing power of 2 whose XOR and Sum of elements equals X
  354. Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
  355. GCD of elements which occur prime number of times
  356. Find the permutation of first N natural numbers such that sum of i % Pi is maximum possible
  357. Bitwise XOR of elements having odd frequency
  358. Count equal element pairs in the given array
  359. Count number of Special Set
  360. Printing the Triangle Pattern using last term N