Introduction to Data Structures – Notes
1.1 INTRODUCTION
A Data Structure is a way of storing and organizing data so it can be used efficiently. It consists of:
- Base storage method (e.g., array, linked list)
- Operations to access/modify data
Elementary Data Organization
- Data = values or sets of values
- Data item = single unit of value
- Elementary items = indivisible
- Group items = can be subdivided
- Hierarchy: Field → Record → File
Name Age Sex
Geetha 20 F
Rajesh 22 M
1.2 DATA STRUCTURE
Steps in studying data structures:
1. Logical description (model)
2. Implementation (on computer)
3. Analysis (time & memory)
Abstract Data Type (ADT):
Logical model of data type that defines what operations can be done, but not how.
Types of Data Structures:
1. Linear Data Structures → Array, Linked List, Stack, Queue
2. Non-Linear Data Structures → Graph, Tree
1.2.1 Linear Data Structures
Arrays: Collection of similar items stored in contiguous memory.
Linked List: Collection of nodes (Data + Address).
Stack: LIFO structure. Operations: Push, Pop.
Queue: FIFO structure. Operations: Enqueue, Dequeue.
1.2.2 Non-Linear Data Structures
Graph: Set of nodes (vertices) and connections (edges). Example: road maps, networks.
Tree: Hierarchical structure with root, branches, and leaves.
1.3 DATA STRUCTURE OPERATIONS
Common operations are:
1. Sorting
2. Searching
3. Insertion
4. Traversing
5. Updation
6. Deletion
7. Merging
1.4 ALGORITHM
An algorithm is a step-by-step procedure to solve a problem.
Properties:
1. Input – takes data
2. Output – produces result
3. Definiteness – steps are clear
4. Finiteness – must end after finite steps
5. Effectiveness – steps must be doable