Used in printer buffers and CPU task scheduling (Enqueue/Dequeue operations). 5. Basic Algorithmic Logic: Searching and Sorting
Early studies in algorithms focus on rearranging and finding data: Moving from Linear Search ( ) to Binary Search ( ), which requires sorted data.
Arrays are collections of elements stored in contiguous memory locations. Fast access via index ( Cons: Fixed size; insertions and deletions are costly ( ) as elements must be shifted. 3.2 Dynamic Structures: Linked Lists
Dynamic sizing and efficient insertions/deletions at known positions. 4. Abstract Data Types (ADTs): Stacks and Queues