1. String Permutationshistorical

    Generate all string permutations using recursive backtracking, deduplicate them, and sort them lexicographically.

  2. Jump Floorhistorical

    Use the Fibonacci recurrence to calculate the number of ways a frog can climb the stairs.

  3. Jump Floor IIhistorical

    Derive the number of ways to climb stairs when each jump may cover any number of steps using a recurrence and a pattern.

  4. Fibonacci Sequencehistorical

    Record three implementations of the Fibonacci sequence: recursion, memoization, and dynamic programming.

  5. Number of 1 Bitshistorical

    Count the number of 1 bits in a 32-bit binary representation by shifting through each bit.

  6. Integer Power of a Numberhistorical

    Calculate a floating-point number raised to an integer power using repeated multiplication, including negative exponents.

  7. Number of Digit 1 Occurrenceshistorical

    Enumerate integers and use modulo operations to count occurrences of digit 1 in decimal representations from 1 to n.

  8. First Non-Repeating Character in a Character Streamhistorical

    Use a map to count character occurrences while preserving input order to find the first character that appears only once in a stream.

  9. Left Rotate Stringhistorical

    Record two implementations of cyclic left rotation of a string: slicing and concatenation, and three reversals.

  10. Poker Straighthistorical

    Sort five cards, treat jokers as 0, and use the gaps between non-zero cards to determine whether they can form a straight.

  11. Replace Spaceshistorical

    Record two implementations for replacing spaces with %20: character-by-character concatenation and preallocated storage.

  12. Print Linked List from Tail to Headhistorical

    Record recursive and stack-based methods for outputting a linked list from tail to head.

  13. Reverse Linked Listhistorical

    Record stack-based and three-pointer implementations for reversing a singly linked list.

  14. Merge Two Sorted Linked Listshistorical

    Record iterative and recursive implementations for merging two sorted linked lists.

  15. K-th Node from the End of a Linked Listhistorical

    Record array, length-conversion, and fast-slow-pointer methods for finding the k-th node from the end.

  16. Copy Complex Linked Listhistorical

    Record the method of copying a complex linked list by inserting copied nodes after the original nodes.

  17. Entry Node of a Loop in a Linked Listhistorical

    Record set-based and fast/slow-pointer methods for finding the entry node of a linked-list cycle.

  18. First Common Node of Two Linked Listshistorical

    Record a two-pointer method that uses the length difference to find the first common node of two linked lists.

  19. Delete Duplicate Nodes in a Linked Listhistorical

    Record counting- and set-based methods for deleting all duplicate nodes from a sorted linked list.

  20. Postorder Traversal Sequence of a Binary Search Treehistorical

    Record a recursive method for determining whether a sequence is the postorder traversal result of a binary search tree.

  21. Next Node in a Binary Treehistorical

    Record methods for finding the inorder successor of a binary-tree node through a full inorder traversal or parent-pointer relationships.

  22. Binary Search Tree and Doubly Linked Listhistorical

    Record inorder-traversal and recursive methods for converting a binary search tree into a sorted doubly linked list.

  23. Kth Node in a Binary Search Treehistorical

    Record inorder-traversal methods for finding the kth smallest node in a binary search tree, plus reverse inorder traversal for the kth largest node.

  24. Depth of a Binary Treehistorical

    Record a recursive method for computing binary-tree depth by taking the greater depth of the left and right subtrees.

  25. Print a Binary Tree from Top to Bottomhistorical

    Record queue-based level-order traversal for printing binary-tree nodes from top to bottom.

  26. Symmetric Binary Treehistorical

    Record a recursive method for determining whether a binary tree is symmetric by comparing mirrored positions in its left and right subtrees.

  27. Balanced Binary Treehistorical

    Record a method for determining whether a binary tree is balanced by comparing subtree heights and recursively checking both subtrees.

  28. Mirror of a Binary Treehistorical

    Record recursive, stack-based, and queue-based methods for generating the mirror of a binary tree by swapping left and right subtrees.

  29. Print a Binary Tree in Multiple Lineshistorical

    Record a queue-based method that uses end-of-line pointers to print a binary tree level by level, one line per level.

  30. Print a Binary Tree in Zigzag Orderhistorical

    Record a zigzag traversal method by reversing alternating rows after level-order traversal.

  31. Substructure of a Treehistorical

    Record a preorder-recursive matching method for determining whether one binary tree is a substructure of another.

  32. Reconstruct Binary Treehistorical

    Record the recursive method for reconstructing a binary tree from preorder and inorder traversal results.

  33. Paths in a Binary Tree With a Given Sumhistorical

    Record the depth-first, preorder traversal, and backtracking method for finding binary-tree paths with a given sum.

  34. Serialize a Binary Treehistorical

    Record methods for serializing and deserializing a binary tree using preorder traversal and a preorder-plus-inorder traversal combination.

  35. Convert a String to an Integerhistorical

    Record character parsing and atoi implementations for converting a string to an integer.

  36. Reverse Word Orderhistorical

    Record methods for reversing word order by splitting the string and by reversing twice.

  37. Stack with a min Functionhistorical

    Record using an auxiliary minimum stack to retrieve the stack minimum in O(1) time.

  38. Stack Push and Pop Sequenceshistorical

    Record methods that use an auxiliary stack to determine whether a given sequence is a valid pop sequence.

  39. Implement a Queue with Two Stackshistorical

    Record how to implement queue Push, Pop, Peek, and Empty operations using two stacks.

  40. Search in a 2D Arrayhistorical

    Mirror translation of the original Sword Offer note: Search in a 2D Array.

  41. Two Numbers with Sum Shistorical

    Mirror translation of the original Sword Offer note: Two Numbers with Sum S.

  42. Continuous Positive Sequences with Sum Shistorical

    Mirror translation of the original Sword Offer note: Continuous Positive Sequences with Sum S.

  43. Last Remaining Number in a Circlehistorical

    Mirror translation of the original Sword Offer note: Last Remaining Number in a Circle.

  44. Arrange an Array into the Smallest Numberhistorical

    Mirror translation of the original Sword Offer note: Arrange an Array into the Smallest Number.

  45. Count Occurrences in a Sorted Arrayhistorical

    Mirror translation of the original Sword Offer note: Count Occurrences in a Sorted Array.

  46. Number Appearing More Than Half the Timehistorical

    Mirror translation of the original Sword Offer note: Number Appearing More Than Half the Time.

  47. Numbers Appearing Only Oncehistorical

    Mirror translation of the original Sword Offer note: Numbers Appearing Only Once.

  48. Inverse Pairs in an Arrayhistorical

    Mirror translation of the original Sword Offer note: Inverse Pairs in an Array.

  49. Duplicate Number in an Arrayhistorical

    Mirror translation of the original Sword Offer note: Duplicate Number in an Array.

  50. Minimum Number in a Rotated Arrayhistorical

    Mirror translation of the original Sword Offer note: Minimum Number in a Rotated Array.

  51. Smallest K Numbershistorical

    Mirror translation of the original Sword Offer note: Smallest K Numbers.

  52. Robot Movement Rangehistorical

    Mirror translation of the original Sword Offer note: Robot Movement Range.

  53. Maximum in Sliding Windowshistorical

    Mirror translation of the original Sword Offer note: Maximum in Sliding Windows.

  54. Reorder Array with Odd Numbers Before Even Numbershistorical

    Mirror translation of the original Sword Offer note: Reorder Array with Odd Numbers Before Even Numbers.

  55. Maximum Sum of a Contiguous Subarrayhistorical

    Mirror translation of the original Sword Offer note: Maximum Sum of a Contiguous Subarray.