21. Merge Two Sorted Lists
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.
Example:
1 | Input: 1->2->4, 1->3->4 |
JAVA题解:
1 | package algorithm.c3; |
22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Example:
1 | For example, given n = 3, a solution set is: |
JAVA题解:
1 | package algorithm.c3; |