rathbhupendra
rathbhupendra
  1. How to swap two numbers without using a temporary variable?
  2. Remove duplicates from a given string
  3. Write a program to calculate pow(x,n)
  4. Program to find whether a no is power of two
  5. Lucky Numbers
  6. Write a function to get Nth node in a Linked List
  7. Given only a pointer/reference to a node to be deleted in a singly linked list, how do you delete it?
  8. Detect loop in a linked list
  9. Find the node with minimum value in a Binary Search Tree
  10. Smallest power of 2 greater than or equal to n
  11. Write a function to delete a Linked List
  12. Print reverse of a string using recursion
  13. Write a program to Calculate Size of a tree | Recursion
  14. Write Code to Determine if Two Trees are Identical
  15. Write a Program to Find the Maximum Depth or Height of a Tree
  16. Write a program to Delete a Tree
  17. Check for Integer Overflow
  18. Write a program to print all permutations of a given string
  19. Little and Big Endian Mystery
  20. Write a function that counts the number of times a given int occurs in a Linked List
  21. Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?
  22. Write a program to add two numbers in base 14
  23. Write a function to get the intersection point of two Linked Lists
  24. Minimum number of jumps to reach end
  25. Given a binary tree, print out all of its root-to-leaf paths one per line.
  26. Lowest Common Ancestor in a Binary Search Tree.
  27. Count set bits in an integer
  28. Given a linked list which is sorted, how will you insert in sorted way
  29. Find the two non-repeating elements in an array of repeating elements
  30. Compute the minimum or maximum of two integers without branching
  31. Compute the integer absolute value (abs) without branching
  32. Level Order Tree Traversal
  33. Block swap algorithm for array rotation
  34. A program to check if a binary tree is BST or not
  35. Merge two sorted linked lists
  36. Print reverse of a Linked List without actually reversing
  37. Count Inversions in an array | Set 1 (Using Merge Sort)
  38. Two elements whose sum is closest to zero
  39. Find the smallest and second smallest elements in an array
  40. Convert an arbitrary Binary Tree to a tree that holds Children Sum Property
  41. Remove duplicates from a sorted linked list
  42. How to determine if a binary tree is height-balanced?
  43. Segregate 0s and 1s in an array
  44. Reverse a Doubly Linked List
  45. Split a Circular Linked List into two halves
  46. Root to leaf path sum equal to a given number
  47. Print list items containing all characters of a given word
  48. Maximum size square sub-matrix with all 1s
  49. Construct Tree from given Inorder and Preorder traversals
  50. Given a binary tree, print all root-to-leaf paths
  51. Practice questions for Linked List and Recursion
  52. Move last element to front of a given Linked List
  53. Pairwise swap elements of a given linked list
  54. Double Tree
  55. Print all combinations of points that can compose a given number
  56. Find the largest BST subtree in a given Binary Tree | Set 1
  57. Delete a node in a Doubly Linked List
  58. Ceiling in a sorted array
  59. Equilibrium index of an array
  60. Delete alternate nodes of a Linked List
  61. Maximum width of a binary tree
  62. A Product Array Puzzle
  63. Alternating split of a given Singly Linked List | Set 1
  64. Write you own Power without using multiplication(*) and division(/) operators
  65. Merge Sort for Linked Lists
  66. Identical Linked Lists
  67. Segregate Even and Odd numbers
  68. Find the two repeating elements in a given array
  69. Foldable Binary Trees
  70. Reverse a Linked List in groups of given size | Set 1
  71. Turn off the rightmost set bit
  72. Add 1 to a given number
  73. Print nodes at k distance from root
  74. Connect nodes at same level
  75. Print a given matrix in spiral form
  76. Sorted insert for circular linked list
  77. Print BST keys in the given range
  78. Program to count number of set bits in an (big) array
  79. Rearrange positive and negative numbers in O(n) time and O(1) extra space
  80. Sliding Window Maximum (Maximum of all subarrays of size k)
  81. Find the smallest window in a string containing all characters of another string
  82. Check if array elements are consecutive | Added Method 3
  83. Reverse alternate K nodes in a Singly Linked List
  84. Rabin-Karp Algorithm for Pattern Searching
  85. Segregate even and odd nodes in a Linked List
  86. Overlapping Subproblems Property in Dynamic Programming | DP-1
  87. Given an array arr[], find the maximum j - i such that arr[j] > arr[i]
  88. Maximum Length Bitonic Subarray | Set 1 (O(n) time and O(n) space)
  89. XOR Linked List – A Memory Efficient Doubly Linked List | Set 2
  90. A Boolean Array Puzzle
  91. Floor and Ceil from a BST
  92. Longest Common Subsequence | DP-4
  93. Optimized Naive Algorithm for Pattern Searching
  94. Sudoku | Backtracking-7
  95. Check if a binary tree is subtree of another binary tree | Set 1
  96. Add two numbers represented by linked lists | Set 1
  97. Average of a stream of numbers
  98. Delete a given node in Linked List under given constraints
  99. Length of the longest substring without repeating characters
  100. Find a Fixed Point (Value equal to index) in a given array
  101. Count total set bits in all numbers from 1 to n
  102. Connect nodes at same level using constant extra space
  103. Find the maximum element in an array which is first increasing and then decreasing
  104. Sorted Linked List to Balanced BST
  105. Sorted Array to Balanced BST
  106. Implement two stacks in an array
  107. Check whether two strings are anagram of each other
  108. Populate Inorder Successor for all nodes
  109. In-place conversion of Sorted DLL to Balanced BST
  110. Print all permutations with repetition of characters
  111. AVL Tree | Set 1 (Insertion)
  112. Print all interleavings of given two strings
  113. Interleaving of two given strings with no common characters
  114. Binomial Coefficient | DP-9
  115. Convert a given tree to its Sum Tree
  116. AVL Tree | Set 2 (Deletion)
  117. Add two numbers without using arithmetic operators
  118. 0-1 Knapsack Problem | DP-10
  119. Merge Two Balanced Binary Search Trees
  120. Find the maximum sum leaf to root path in a Binary Tree
  121. Pattern Searching | Set 6 (Efficient Construction of Finite Automata)
  122. Finite Automata algorithm for Pattern Searching
  123. Hamiltonian Cycle | Backtracking-6
  124. Swap bits in a given number
  125. Find a triplet that sum to a given value
  126. Maximum Sum Increasing Subsequence | DP-14
  127. Boyer Moore Algorithm for Pattern Searching
  128. Find subarray with given sum | Set 1 (Nonnegative Numbers)
  129. Find the smallest positive number missing from an unsorted array | Set 1
  130. Find the two numbers with odd occurrences in an unsorted array
  131. Merge two BSTs with limited extra space
  132. Floyd Warshall Algorithm | DP-16
  133. Find a sorted subsequence of size 3 in linear time
  134. Palindrome Partitioning | DP-17
  135. Largest subarray with equal number of 0s and 1s
  136. Word Wrap Problem | DP-19
  137. Partition problem | DP-18
  138. Construct Special Binary Tree from given Inorder traversal
  139. Count numbers that don't contain 3
  140. Maximum Product Subarray
  141. Magic Square
  142. Find a pair with the given difference
  143. Find day of the week for a given date
  144. Find a triplet from three linked lists with sum equal to a given number
  145. DFA based division
  146. Rotate a Linked List
  147. Replace every element with the greatest element on right side
  148. Maximum Length Chain of Pairs | DP-20
  149. Find four elements that sum to a given value | Set 1 (n^3 solution)
  150. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  151. Check whether a given Binary Tree is Complete or not | Set 1 (Iterative Solution)
  152. Make a fair coin from a biased coin
  153. Maximum circular subarray sum
  154. Find the row with maximum number of 1s
  155. Median of two sorted arrays of different sizes
  156. Print unique rows in a given boolean matrix
  157. Check divisibility by 7
  158. Find the element that appears once
  159. Count the number of possible triangles
  160. Construct Full Binary Tree from given preorder and postorder traversals
  161. Lexicographic rank of a string
  162. Print all permutations in sorted (lexicographic) order
  163. Shuffle a given array using Fisher–Yates shuffle Algorithm
  164. Construct BST from given preorder traversal | Set 1
  165. Construct BST from given preorder traversal | Set 2
  166. Iterative Quick Sort
  167. An in-place algorithm for String Transformation
  168. Space and time efficient Binomial Coefficient
  169. Longest Palindromic Substring | Set 2
  170. Add two numbers represented by linked lists | Set 2
  171. Find the number of islands | Set 1 (Using DFS)
  172. Reservoir Sampling
  173. Given a sequence of words, print all anagrams together | Set 1
  174. Disjoint Set (Or Union-Find) | Set 1 (Detect Cycle in an Undirected Graph)
  175. Iterative Postorder Traversal | Set 1 (Using Two Stacks)
  176. Select a random number from stream, with O(1) space
  177. Kruskal’s Minimum Spanning Tree Algorithm | Greedy Algo-2
  178. Efficient Huffman Coding for Sorted Input | Greedy Algo-4
  179. Prim’s Minimum Spanning Tree (MST) | Greedy Algo-5
  180. Closest Pair of Points using Divide and Conquer algorithm
  181. Program to print last 10 lines
  182. Optimal Binary Search Tree | DP-24
  183. Efficient program to calculate e^x
  184. Sort a linked list of 0s, 1s and 2s
  185. Write your own strcmp that ignores cases
  186. Efficient program to print all prime factors of a given number
  187. Morris traversal for Preorder
  188. Linked complete binary tree & its creation
  189. The Stock Span Problem
  190. Segment Tree | Set 1 (Sum of given range)
  191. Segment Tree | Set 2 (Range Minimum Query)
  192. Find the first circular tour that visits all petrol pumps
  193. Count words in a given string
  194. Largest Independent Set Problem | DP-26
  195. Flatten a multilevel linked list
  196. Arrange given numbers to form the biggest number | Set 1
  197. Maximum sum rectangle in a 2D matrix | DP-27
  198. Pancake sorting
  199. A Pancake Sorting Problem
  200. Find if there is a triplet in a Balanced BST that adds to zero
  201. Swap all odd and even bits
  202. Tug of War
  203. Find a pair with given sum in a Balanced BST
  204. Reverse Level Order Traversal
  205. Zigzag (or diagonal) traversal of Matrix
  206. Maximum Subarray Sum using Divide and Conquer algorithm
  207. Counting Sort
  208. Find position of the only set bit
  209. Convert a given Binary Tree to Doubly Linked List | Set 1
  210. Stock Buy Sell to Maximize Profit
  211. Write your own atoi()
  212. QuickSort on Doubly Linked List
  213. Minimum insertions to form a palindrome | DP-28
  214. Longest Common Substring | DP-29
  215. Print all possible combinations of r elements in a given array of size n
  216. Unbounded Binary Search Example (Find the point where a monotonically increasing function becomes positive first time)
  217. Random number generator in arbitrary probability distribution fashion
  218. Design a stack with operations on middle element
  219. Delete N nodes after M nodes of a linked list
  220. Check for Identical BSTs without building the trees
  221. Find the minimum element in a sorted and rotated array
  222. Convert a given Binary Tree to Doubly Linked List | Set 2
  223. Assembly Line Scheduling | DP-34
  224. Radix Sort
  225. Difference between sums of odd level and even level nodes of a Binary Tree
  226. Merge a linked list into another linked list at alternate positions
  227. Print Left View of a Binary Tree
  228. Add all greater values to every node in a given BST
  229. Extract Leaves of a Binary Tree in a Doubly Linked List
  230. Pairwise swap elements of a given linked list by changing links
  231. Splay Tree | Set 1 (Search)
  232. Splay Tree | Set 2 (Insert)
  233. Sum of all the numbers that are formed from root to leaf paths
  234. Given a linked list, reverse alternate nodes and append at the end
  235. Calculate the angle between hour hand and minute hand
  236. Given a linked list of line segments, remove middle points
  237. Swap nodes in a linked list without swapping data
  238. Point to next higher value node in a linked list with an arbitrary pointer
  239. Merge Sort for Doubly Linked List
  240. Rearrange a linked list such that all even and odd positioned nodes are together
  241. Add 1 to a number represented as linked list
  242. Print Binary Tree in 2-Dimensions
  243. Decimal Equivalent of Binary Linked List
  244. Unrolled Linked List | Set 1 (Introduction)
  245. Deletion from a Circular Linked List
  246. Program to print the diamond shape
  247. Program to find second most frequent character
  248. Find maximum (or minimum) in Binary Tree
  249. Change a Binary Tree so that every node stores sum of all nodes in left subtree
  250. How to implement decrease key or change key in Binary Search Tree?
  251. Insertion Sort
  252. QuickSort
  253. Selection Sort
  254. Bubble Sort
  255. Program to find sum of elements in a given array
  256. Program to check if a given year is leap year
  257. Program to multiply two matrices
  258. Program for Tower of Hanoi
  259. Program for addition of two matrices
  260. Program for subtraction of matrices
  261. Program to find area of a triangle
  262. Program to print first n Fibonacci Numbers | Set 1
  263. C Program to print Floyd's triangle
  264. Iterative Search for a key 'x' in Binary Tree
  265. Linked List | Set 1 (Introduction)
  266. Linked List | Set 2 (Inserting a node)
  267. Queue | Set 2 (Linked List Implementation)
  268. Doubly Linked List | Set 1 (Introduction and Insertion)
  269. Circular Linked List | Set 2 (Traversal)
  270. Find Length of a Linked List (Iterative and Recursive)
  271. Search an element in a Linked List (Iterative and Recursive)
  272. Stack | Set 3 (Reverse a string using stack)
  273. Stack | Set 4 (Evaluation of Postfix Expression)
  274. Queue | Set 1 (Introduction and Array Implementation)
  275. Stack Data Structure (Introduction and Program)
  276. Check whether the length of given linked list is Even or Odd
  277. Program to sort an array of strings using Selection Sort
  278. Squareroot(n)-th node in a Linked List
  279. Rotate Linked List block wise
  280. Make middle node head in a linked list
  281. Program to print hollow rectangle or square star patterns
  282. Sorted insert in a doubly linked list with head and tail pointers
  283. Sum and Product of maximum and minimum element in Binary Tree