Part 2
Arrays
16lessons1 h 39 min0done
An array keeps elements of the same type side by side in memory. That is why any element is reached by its index in O(1), but inserting into or deleting from the middle means shifting the elements behind it.
The part opens with an introduction. Then the array operations follow in the same order as the linked list lessons, so you can compare the two structures operation by operation. Dynamic arrays, two-dimensional arrays and exam questions complete the part.
- 2.1.1Creating an array5 min
- 2.1.2Traversing an array4 min
- 2.1.3Inserting at the end4 min
- 2.1.4Inserting at a position6 min
- 2.1.5Inserting at the front5 min
- 2.1.6Deleting from the end4 min
- 2.1.7Deleting from the front5 min
- 2.1.8Deleting from the middle6 min
- 2.1.9Searching for a value4 min
- 2.1.10Reversing an array5 min