Data Structures & Algorithms
237 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- Product of Array Except Selfhistorical
Compute the product of array elements except self using left and right product arrays.
- Sort Colorshistorical
Sort 0, 1, and 2 in place using quicksort, bucket sort, or the move-zeroes idea.
- Search a 2D Matrixhistorical
Search a matrix whose rows and columns are both sorted, starting from the top-right corner.
- Jump Floorhistorical
Use the Fibonacci recurrence to calculate the number of ways a frog can climb the stairs.
- 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.
- Fibonacci Sequencehistorical
Record three implementations of the Fibonacci sequence: recursion, memoization, and dynamic programming.
- Number of 1 Bitshistorical
Count the number of 1 bits in a 32-bit binary representation by shifting through each bit.
- Integer Power of a Numberhistorical
Calculate a floating-point number raised to an integer power using repeated multiplication, including negative exponents.
- Number of Digit 1 Occurrenceshistorical
Enumerate integers and use modulo operations to count occurrences of digit 1 in decimal representations from 1 to n.