Skip to content

Recursion

Mission Peace edited this page Oct 19, 2016 · 3 revisions
  1. Generate all combination of size k and less of adjacent numbers - AllAdjacentCombination.java
  2. Generate all bracket combination, check if brackets open and closing is correct or not - Bracketology.java
  3. Given an array of strings, find if the given strings can be chained to form a circle. A string X can be put before another string Y in circle if the last character of X is same as first character of Y - ChainWordsToFormCircle.java
  4. Generate all combinations - Combination.java
  5. Generate all combination of size k - CombinationOfSizeK.java
  6. Generate all combination which prints star in place of absent characters - CombinationWithStar.java
  7. Consider a coding system for alphabets to integers where ‘a’ is represented as 1, ‘b’ as 2, .. ‘z’ as 26. Given an array of digits (1 to 9) as input, write a function that prints all valid interpretations of input array - InterpretationOfArray.java
  8. Generate all possible string combinations of a given phone number - KeyPadPermutation.java
  9. Minimum edits required to generate reverse polish notation - MinimumEditForReversePolishNotation.java
  10. Given a board of size nxn and n queens, place them on the board so that they don't attack each other - NQueenProblem.java
  11. Given two strings check if they are one distance away from each other where you can delete,edit or add characters - OneEditApart.java
  12. Print all paths from top left corner to bottom right corner - PrintAllPathFromTopLeftToBottomRight.java
  13. Given an array find number of interpretations possible for combinations of adjacent characters - PrintArrayInAdjacentWay.java
  14. Print array in tree fashion - PrintArrayInCustomizedFormat.java
  15. Permutation of string in both sorted and unsorted order - StringPermutation.java stringpermutation.py StringPermutationRotation.java
  16. Given two strings, generate all interleavings of these strings - StringInterleaving.java
  17. Shuffle a character array so that no two repeated characters are together. [FancyShuffle.java] (https://github.com/mission-peace/interview/blob/master/src/com/interview/recursion/FancyShuffle.java)
  18. Given an input and total, print all combinations with repetitions in this input which sums to given total. PrintSumCombination.java
  19. Given a List of List of Strings. Print cartesian product of List. WordCombination.java
  20. Given input of unique elements and pair among those elements. How many minimum swaps are needed to arrange pair adjacent to each other. SetPairTogether.java setpairtogether.py
  21. Given input string e.g 123 and target e.g 6, place operator +, - and * so that 123 evaluates to 6. OperatorAdditionForTarget.java
  22. Print all permutations of given input array - PrintAllSubsequence.java
  23. Reconstruct itinerary based on ticket - ReconstructItinerary.java
  24. Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results - RemoveInvalidParenthesis.java
  25. Sudoku solver - SudokuSolver.java
  26. Restore ip address - RestoreIPAddresses.java
  27. Find absolute longest path in directory structure represented by \n and \t - LongestAbsolutePath.java
Clone this wiki locally