The goal is to have in a single place for all possible GeeksForGeeks : Competitive Programming solutions - in multiple languages. We aim to achieve this collaboratively, so feel free to contribute in any way you want!.
Please create an issue if you wish to add code in a language that is not currently here. Do not create folders in your submissions unless specifically told to do so.
- Add 1 to number represented by Linked List [CPP]
- Add two numbers represented by linked lists [CPP]
- Array to BST [CPP]
- Binary Tree to BST [CPP]
- Binary Tree to DLL [CPP]
- Binary Tree to DLL [JAVA]
- Bipartite Graph [CPP]
- Bottom View of Binary Tree [CPP]
- Boundary Traversal of binary tree [CPP]
- Brothers From Different Roots [CPP]
- Check if a given graph is tree or not[CPP]
- Check if it is possible to survive on Island [CPP]
- Check if Circular Linked List [CPP]
- Check if Tree is Isomorphic [CPP]
- Check Mirror in N-ary tree [CPP]
- Check for BST [CPP]
- Check for Balanced Tree [CPP]
- Check for path more than K-length from source to any other vertex [CPP]
- Check if Linked List is Palindrome [CPP]
- Check whether BST contains Dead End [CPP]
- Chocolate Distribution Problem [CPP]
- Choose and Swap [CPP]
- Clone a linked list with next and random pointer [CPP]
- Common elements [CPP]
- Construct Binary Tree from String with bracket [CPP]
- Construct BST from preorder [CPP]
- Construct Tree from Inorder and Preorder [CPP]
- Convert a normal BST to Balanced BST [CPP]
- Count Inversions [CPP]
- Count Squares [CPP]
- Count BST nodes that lie in given range [CPP]
- Count pairs with given sum [CPP]
- Count triplets in sorted DLL with sum equal to X [CPP]
- Cyclically rotate an array by one [CPP]
- Delete nodes having greater value on right [CPP]
- Deletion from Circular Linked List [CPP]
- Detect Loop in linked list [CPP]
- Determine if Two Trees are Identical [CPP]
- Diameter of Binary Tree in O(n) [CPP]
- Diameter of Binary Tree in O(n*n) [CPP]
- Duplicate subtree in Binary Tree [CPP]
- Evaluation of Postfix Expression [CPP]
- Expression contains redundant bracket or not
- Factorials of large numbers [CPP]
- Find Missing And Repeating [CPP]
- Given n appointments, find all conflicting appointments [CPP]
- Find duplicates in an array [CPP]
- Find largest subtree sum in a tree [CPP]
- Find maximum meetings in one room-Greddy [CPP]
- Find maximum sum possible equal sum of three stacks [CPP]
- Find minimum and maximum element in an array [PYTHON]
- Find whether it is possible to finish all tasks or not from given dependencies [CPP]
- First and last occurrences of X [CPP]
- First node of loop in list [CPP]
- First non-repeating character in a stream [CPP]
- Flatten BST to a list [CPP]
- Flatten BST to a sorted list [CPP]
- Flattening a Linked List [CPP]
- Fractional Knapsack [CPP]
- Given a linked list of 0s, 1s and 2s, sort it. [CPP]
- Hamiltonian Path [CPP]
- Height of Binary Tree [CPP]
- Huffman Encoding [CPP]
- Implement two stacks in an array [CPP]
- Inorder of Tree Iterative [CPP]
- Insert a node in a BST [CPP]
- Insertion at the end of stack [CPP]
- Intersection Point in Y Shaped Linked Lists [CPP]
- Intersection Point in Y Shaped Linked Lists Approach-2 [CPP]
- Intersection of two arrays [CPP]
- Intersection of two sorted Linked lists [CPP]
- Job Sequencing Problem [CPP]
- K largest elements [CPP]
- Kth-ancestor of a node in binary tree [CPP]
- Kth Smallest Largest Element using HEAP [CPP]
- Kth largest element in BST [CPP]
- Kth smallest element in BST [CPP]
- Largest BST [CPP]
- Leaf at Same Level [CPP]
- Left View of Binary Tree [CPP]
- Level Order Traversal [CPP]
- Lowest Common Ancestor in BST [CPP]
- Lowest Common Ancestor in a Binary Tree [CPP]
- Maximize sum arr[i]xi of an Array [CPP]
- Maximize sum after K negations [CPP]
- Maximum Rectangular Area in a Histogram [CPP]
- Maximum Stocks if i stocks to be bought on i-th day [CPP]
- Maximum and Minimum of Array Elements [CPP]
- Maximum level sum in Binary Tree [CPP]
- Maximum product subset of an array [CPP]
- Maximum sum of absolute difference of any permutation [CPP]
- Maximum sum of non-adjacent nodes of BT [CPP]
- Maximum trains for which stoppage can be provided [CPP]
- Median of BST without extra-space and in O(n) time [CPP]
- Merge K sorted linked lists [CPP]
- Merge Overlapping Intervals [CPP]
- Merge Sort for Linked List [JAVA]
- Merge two BST's [CPP]
- Merge two Balanced BSTs [CPP]
- Middle of Three [CPP]
- Min distance between two given nodes of a Binary Tree [CPP]
- Minimum Cost of ropes [CPP]
- Minimum Cost to cut board into squares [CPP]
- Minimum Platforms [CPP]
- Minimum element in BST [CPP]
- Minimum sum of absolute difference of pairs of two arrays [CPP]
- Minimum swap required to convert binary tree to binary search tree[CPP]
- Mirror of binary tree [CPP]
- Move last element to front of given Linked List [CPP]
- Multiply two linked lists [CPP]
- N meetings in one room [CPP]
- Negative weight cycle or BellmanFord Algorithm [JAVA]
- Next Greater Element [CPP]
- Nth node from end of linked list [CPP]
- Number of 1 Bits [CPP]
- Page Faults in LRU [CPP]
- Pairs with given sum in doubly linked list [CPP]
- Palindrome String [CPP]
- Parenthesis Checker [CPP]
- Populate Inorder Successor for all nodes [CPP]
- Postorder of Tree Iterative-1 using Stack [CPP]
- Postorder of Tree Iterative-2 using Stack [CPP]
- Predecessor and Successor [CPP]
- Preorder of Tree Iterative [CPP]
- Preorder to Postorder [CPP]
- Print all k-sum paths in a binary tree [CPP]
- Print nodes between two given levels of Binary Tree [CPP]
- Print nodes between two given levels of Binary Tree using Queue [CPP]
- Program for Shortest Job First [CPP]
- Quick Sort on Linked List [CPP]
- Rearrange Characters [CPP]
- Remove duplicate element from sorted Linked List [CPP]
- Remove duplicates from an unsorted linked list [CPP]
- Remove loop in Linked List [CPP]
- Replace Element with Greatest Element on its Right [CPP]
- Reverse DLL in groups of a given size [CPP]
- Reverse Level Order Traversal [CPP]
- Reverse a Doubly Linked List [CPP]
- Reverse a Linked List in groups of given size [CPP]
- Reverse a String [CPP]
- Reverse a linked list [CPP]
- Reverse a stack using recursion [CPP]
- Reverse a string using Stack [CPP]
- Right View of Binary Tre [CPP]
- Rotate Doubly linked list by N nodes [CPP]
- Second Largest [CPP]
- Segregate even and odd nodes in a Link List [CPP]
- Shop in Candy Store [CPP]
- Smallest number [CPP]
- Smallest subset with sum greater than all other elements [CPP]
- Sort a K-sorted DLL [CPP]
- Sort a stack [CPP]
- Sort an array of 0s 1s and 2s [CPP]
- Sorted matrix [CPP]
- Special Stack [CPP]
- Spirally traversing a matrix [CPP]
- Split a Circular Linked List into two halves [CPP]
- Stack using two queues [CPP]
- Stack with operations on middle element [CPP]
- Steps by Knight [CPP]
- String is a valid shuffle of 2 strings or not [CPP]
- String is shuffled substring of other string [CPP]
- Sum Tree [CPP]
- Sum of the Longest Bloodline of a Tree [CPP]
- Swap and Maximize [CPP]
- The Celebrity Problem [CPP]
- Top View of Binary Tree [CPP]
- Top View of a Binary Tree [CPP]
- Topological Sort [CPP]
- Transform to Sum Tree [CPP]
- Triplet Sum in Array [CPP]
- Union of two arrays [CPP]
- Union of two arrays [PYTHON]
- Valid Substring [CPP]
- Value equal to Index value [CPP]
- Zero Sum Subarrays [CPP]
- ZigZag Tree Traversal [CPP]