Made with ScholarlyTurn your own files into documents like this
Shared by sunaina naram
This document provides a foundational guide for Data Structures, covering classifications, algorithm complexity, common data structures like arrays, stacks, and trees, and basic searching/sorting techniques (pp. 1-4). It serves as a reference for understanding how to organize and manipulate data to optimize memory usage and access time.
Algorithm efficiency is categorized by two metrics: Time Complexity, which describes execution time relative to input size (n, p. 1), and Space Complexity, which defines the memory required for execution (p. 1). When choosing algorithms, developers often evaluate the Time-Space Trade-off, where performance can be optimized by either increasing memory usage (e.g., using lookup tables) or increasing execution time (e.g., re-calculating values) (p. 2).
Algorithms are measured using specific notations to establish boundaries (p. 1):
Sorting algorithms rearrange data, and Insertion Sort builds a sorted array one element at a time (p. 2). For the array [12, 11, 13, 5, 6], the process follows these steps:
[11, 12, 13, 5, 6].[5, 11, 12, 13, 6].[5, 6, 11, 12, 13] (p. 2).Hashing maps keys to specific indices in a Hash Table using a hash function (p. 3). When two keys produce the same hash index, a Collision occurs. These are resolved via:
These linear data structures operate on strict insertion/removal principles:
Make from this