├── Chapter 1 ├── q1 isUnique.cpp ├── q2 isPermutation.cpp ├── q3 URLify.cpp ├── q4 Palindrome Permutation.cpp ├── q5 One Away.cpp ├── q6 String Compression.cpp ├── q7 Rotate Matrix.cpp ├── q8 Zero Matrix.cpp └── q9 String Rotation.cpp ├── Chapter 10 Sorting and Searching ├── q1 sortedMerge.cpp ├── q2 groupAnagrams.cpp ├── q3 searchInRotatedArray.cpp ├── q4 sortedSearchNoSize.cpp └── q5 sparseSearch.cpp ├── Chapter 2 ├── linkedList.cpp ├── linkedList.h ├── q1 Remove Duplicates.cpp ├── q2 kthToLast.cpp ├── q3 DeleteMiddle.cpp ├── q4 Partition.cpp ├── q5 SumLists.cpp ├── q6 Palindrome.cpp ├── q7 Intersection.cpp └── q8 LoopDetection.cpp ├── Chapter 3 ├── q1 ThreeInOne.cpp ├── q2 StackMin.cpp ├── q3 StackOfPlates.cpp ├── q4 QueueViaStack.cpp ├── q5 SortStack.cpp ├── q6 AnimalShelter.cpp ├── stack.cpp └── stack.h ├── Chapter 4 ├── binaryTree.cpp ├── binaryTree.h ├── q1 Route.cpp ├── q10 checkSubtree.cpp ├── q11 randomNode.cpp ├── q12 pathsWithSum.cpp ├── q2 MinimalTree.cpp ├── q3 ListOfDepths.cpp ├── q4 isBalanced.cpp ├── q5 validBST.cpp ├── q6 Successor.cpp ├── q7 BuildOrder.cpp ├── q8 FirstCommonAncestor.cpp └── q9 BSTSequences.cpp ├── Chapter 5 ├── bitOperations.cpp ├── bitOperations.h ├── q1 Inserton.cpp ├── q2 BinaryToString.cpp ├── q3 flipBit.cpp ├── q4 nextNumber.cpp ├── q6 Conversion.cpp ├── q7 pairwiseSwap.cpp └── q8 drawLine.cpp └── Chapter 8 Recursion and Dynamic Programming ├── q1 tripleStep.cpp ├── q10 paintFill.cpp ├── q11 coins.cpp ├── q12 eightQueens.cpp ├── q13 stackOfBoxes.cpp ├── q14 booleanEval.cpp ├── q2 robotInGrid.cpp ├── q3 magicIndex.cpp ├── q4 powerSet.cpp ├── q5 recursiveMultiply.cpp ├── q6 towerOfHanoi.cpp ├── q7 permutationsWithoutDups.cpp ├── q8 permutationsWithDups.cpp └── q9 parens.cpp /Chapter 1/q1 isUnique.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q1 isUnique.cpp -------------------------------------------------------------------------------- /Chapter 1/q2 isPermutation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q2 isPermutation.cpp -------------------------------------------------------------------------------- /Chapter 1/q3 URLify.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q3 URLify.cpp -------------------------------------------------------------------------------- /Chapter 1/q4 Palindrome Permutation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q4 Palindrome Permutation.cpp -------------------------------------------------------------------------------- /Chapter 1/q5 One Away.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q5 One Away.cpp -------------------------------------------------------------------------------- /Chapter 1/q6 String Compression.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q6 String Compression.cpp -------------------------------------------------------------------------------- /Chapter 1/q7 Rotate Matrix.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q7 Rotate Matrix.cpp -------------------------------------------------------------------------------- /Chapter 1/q8 Zero Matrix.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q8 Zero Matrix.cpp -------------------------------------------------------------------------------- /Chapter 1/q9 String Rotation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 1/q9 String Rotation.cpp -------------------------------------------------------------------------------- /Chapter 10 Sorting and Searching/q1 sortedMerge.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 10 Sorting and Searching/q1 sortedMerge.cpp -------------------------------------------------------------------------------- /Chapter 10 Sorting and Searching/q2 groupAnagrams.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 10 Sorting and Searching/q2 groupAnagrams.cpp -------------------------------------------------------------------------------- /Chapter 10 Sorting and Searching/q3 searchInRotatedArray.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 10 Sorting and Searching/q3 searchInRotatedArray.cpp -------------------------------------------------------------------------------- /Chapter 10 Sorting and Searching/q4 sortedSearchNoSize.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 10 Sorting and Searching/q4 sortedSearchNoSize.cpp -------------------------------------------------------------------------------- /Chapter 10 Sorting and Searching/q5 sparseSearch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 10 Sorting and Searching/q5 sparseSearch.cpp -------------------------------------------------------------------------------- /Chapter 2/linkedList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/linkedList.cpp -------------------------------------------------------------------------------- /Chapter 2/linkedList.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/linkedList.h -------------------------------------------------------------------------------- /Chapter 2/q1 Remove Duplicates.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q1 Remove Duplicates.cpp -------------------------------------------------------------------------------- /Chapter 2/q2 kthToLast.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q2 kthToLast.cpp -------------------------------------------------------------------------------- /Chapter 2/q3 DeleteMiddle.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q3 DeleteMiddle.cpp -------------------------------------------------------------------------------- /Chapter 2/q4 Partition.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q4 Partition.cpp -------------------------------------------------------------------------------- /Chapter 2/q5 SumLists.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q5 SumLists.cpp -------------------------------------------------------------------------------- /Chapter 2/q6 Palindrome.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q6 Palindrome.cpp -------------------------------------------------------------------------------- /Chapter 2/q7 Intersection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q7 Intersection.cpp -------------------------------------------------------------------------------- /Chapter 2/q8 LoopDetection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 2/q8 LoopDetection.cpp -------------------------------------------------------------------------------- /Chapter 3/q1 ThreeInOne.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/q1 ThreeInOne.cpp -------------------------------------------------------------------------------- /Chapter 3/q2 StackMin.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/q2 StackMin.cpp -------------------------------------------------------------------------------- /Chapter 3/q3 StackOfPlates.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/q3 StackOfPlates.cpp -------------------------------------------------------------------------------- /Chapter 3/q4 QueueViaStack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/q4 QueueViaStack.cpp -------------------------------------------------------------------------------- /Chapter 3/q5 SortStack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/q5 SortStack.cpp -------------------------------------------------------------------------------- /Chapter 3/q6 AnimalShelter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/q6 AnimalShelter.cpp -------------------------------------------------------------------------------- /Chapter 3/stack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/stack.cpp -------------------------------------------------------------------------------- /Chapter 3/stack.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 3/stack.h -------------------------------------------------------------------------------- /Chapter 4/binaryTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/binaryTree.cpp -------------------------------------------------------------------------------- /Chapter 4/binaryTree.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/binaryTree.h -------------------------------------------------------------------------------- /Chapter 4/q1 Route.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q1 Route.cpp -------------------------------------------------------------------------------- /Chapter 4/q10 checkSubtree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q10 checkSubtree.cpp -------------------------------------------------------------------------------- /Chapter 4/q11 randomNode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q11 randomNode.cpp -------------------------------------------------------------------------------- /Chapter 4/q12 pathsWithSum.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q12 pathsWithSum.cpp -------------------------------------------------------------------------------- /Chapter 4/q2 MinimalTree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q2 MinimalTree.cpp -------------------------------------------------------------------------------- /Chapter 4/q3 ListOfDepths.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q3 ListOfDepths.cpp -------------------------------------------------------------------------------- /Chapter 4/q4 isBalanced.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q4 isBalanced.cpp -------------------------------------------------------------------------------- /Chapter 4/q5 validBST.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q5 validBST.cpp -------------------------------------------------------------------------------- /Chapter 4/q6 Successor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q6 Successor.cpp -------------------------------------------------------------------------------- /Chapter 4/q7 BuildOrder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q7 BuildOrder.cpp -------------------------------------------------------------------------------- /Chapter 4/q8 FirstCommonAncestor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q8 FirstCommonAncestor.cpp -------------------------------------------------------------------------------- /Chapter 4/q9 BSTSequences.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 4/q9 BSTSequences.cpp -------------------------------------------------------------------------------- /Chapter 5/bitOperations.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/bitOperations.cpp -------------------------------------------------------------------------------- /Chapter 5/bitOperations.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/bitOperations.h -------------------------------------------------------------------------------- /Chapter 5/q1 Inserton.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q1 Inserton.cpp -------------------------------------------------------------------------------- /Chapter 5/q2 BinaryToString.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q2 BinaryToString.cpp -------------------------------------------------------------------------------- /Chapter 5/q3 flipBit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q3 flipBit.cpp -------------------------------------------------------------------------------- /Chapter 5/q4 nextNumber.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q4 nextNumber.cpp -------------------------------------------------------------------------------- /Chapter 5/q6 Conversion.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q6 Conversion.cpp -------------------------------------------------------------------------------- /Chapter 5/q7 pairwiseSwap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q7 pairwiseSwap.cpp -------------------------------------------------------------------------------- /Chapter 5/q8 drawLine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 5/q8 drawLine.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q1 tripleStep.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q1 tripleStep.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q10 paintFill.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q10 paintFill.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q11 coins.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q11 coins.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q12 eightQueens.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q12 eightQueens.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q13 stackOfBoxes.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q13 stackOfBoxes.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q14 booleanEval.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q14 booleanEval.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q2 robotInGrid.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q2 robotInGrid.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q3 magicIndex.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q3 magicIndex.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q4 powerSet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q4 powerSet.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q5 recursiveMultiply.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q5 recursiveMultiply.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q6 towerOfHanoi.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q6 towerOfHanoi.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q7 permutationsWithoutDups.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q7 permutationsWithoutDups.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q8 permutationsWithDups.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q8 permutationsWithDups.cpp -------------------------------------------------------------------------------- /Chapter 8 Recursion and Dynamic Programming/q9 parens.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aanchal204/Cracking-the-Coding-Interview/HEAD/Chapter 8 Recursion and Dynamic Programming/q9 parens.cpp --------------------------------------------------------------------------------