-
Static Arrays
- Creating 1D, 2D, ND Static Arrays.
- Accessing Time.
- Traversing a static array with N dimensions.
- 1D Array Manipulation.
- 2D Array Manipulation.
- Example: Rotating a matrix.
- Tricks and Pitfalls.
-
Dynamically-Resizable Arrays
- Creating ArrayLists.
- Important functions and their complexities:
add, get, set, set, indexOf, size
- How resizing is done internally + resizing complexity.
- Using Static Arrays with Dynamically-Resizable Arrays.
ArrayList<Integer> a[]
-
Bitmasks
- Bits as a data structure.
- Bit Manipulation.
-
BitSets
- Important functions and their complexities:
reset, set, cardinality, flip, nextSetBit, xor
- Core idea behind BitSets.
- Important functions and their complexities:
-
LinkedLists
- Important functions and their complexities:
get, add, remove
- Important functions and their complexities:
-
Stacks
- Important functions and their complexities.
pop, push, peek, isEmpty
- Applications on Stacks.
- Important functions and their complexities.
-
Queues
- Important functions and their complexities.
- Applications on Queues.
-
Dequeues
Resource | Points Covered |
---|---|
CP section: 2.2 | Most of the outline points |
G4G Apps on Arrays | 1-iv 1D Array Manipulation |
G4G Apps on Stacks | 6-ii Applications on Stacks |
G4G Apps on Queues | 7-ii Applications on Queues |
Supp Material | 1-ii, 1-vi, 4-ii |
Problem | Tags | Notes | Solution |
---|---|---|---|
Boy or Girl | 1D Array manipulation | use a boolean array to keep track whether a character is found or not. | Link |
Splitting Numbers | Bit Manipulation | basic bit manipulation but could be solved with strings + binary decimal conversion. | Link |
Error Correction | 2D Array Manipulation | count the number of '1's for each row/col, all of them must be even , if there is an error then check if it is on the same row and col | Link |
Rails | Stacks | use a stack to simulate the process | Link |
Throwing cards away I | Queues | simulate the process using a queue | Link |
Broken Keyboard | Dequeues , Linked lists | think of a data structure that allow insertion from both sides | Link |
Problem | Tags | Notes | Solution |
---|---|---|---|
Machined Surfaces | 1D Array Manipulation | count the number of 'X's in each row + keep track of their max | Link |
Transform the Expression | Stacks | tricky way to use a stack , not direct | Link |
The Most Potent Corner | Bitmasks | Try to assign a number to every corner such that it is easy to find neighbours of a corner using bit manipulation | Link |
Free Spots | 2D Array Manipulation | use 2D boolean array of size 500 × 500 | Link |
Raising Bacteria | Bit Manipulation | number of ones in binary form | Link |