Category: recursive
Given a collection of distinct numbers, return all possible permutations. For example, have the following permutations: , , , , , and . Recursive Permutation Algorithm At position 1, …
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find …
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Merging …
This problem was inspired by this original tweet by Max Howell: Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree …
We all know that the total number of solution to pick combination of n items out of m items is C(m, n), and sometimes denoted as or . We …