0% found this document useful (0 votes)
3 views3 pages

Data Structures Detailed Notes

Data structures are methods for organizing and storing data efficiently, classified into primitive and non-primitive types, including linear and non-linear structures. Common operations include insertion, deletion, traversal, searching, sorting, and merging, with Abstract Data Types (ADTs) defining data and operations independently of implementation. The document also discusses specific types of data structures like stacks and queues, their algorithms, and applications in various computing scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Data Structures Detailed Notes

Data structures are methods for organizing and storing data efficiently, classified into primitive and non-primitive types, including linear and non-linear structures. Common operations include insertion, deletion, traversal, searching, sorting, and merging, with Abstract Data Types (ADTs) defining data and operations independently of implementation. The document also discusses specific types of data structures like stacks and queues, their algorithms, and applications in various computing scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to Data Structures

A data structure is a particular way of organizing and storing data in a computer so that it can be
accessed and modified efficiently.

Efficient programs depend not only on algorithms but also on proper representation of data.

Example: array for indexed data, linked list for dynamic data.

1 Data item: single unit of value


2 Group items: records, files
3 Data structure = organized collection of data

Classification of Data Structures

Data structures are classified based on organization and memory allocation.

1 Primitive: int, float, char


2 Non-primitive: linear and non-linear
3 Linear: array, linked list, stack, queue
4 Non-linear: tree, graph

Operations on Data Structures

Common operations performed on data structures:

1 Insertion
2 Deletion
3 Traversal
4 Searching
5 Sorting
6 Merging

Abstract Data Type (ADT)

ADT defines data and permitted operations independent of implementation.

Example: Stack ADT only defines push/pop but not array or linked list implementation.

Selecting a Data Structure

Choice depends on application requirements.

1 Time efficiency
2 Memory efficiency
3 Type of operations
4 Frequency of operations
5 Data size
Linear List & Linked Lists

Linear list stores elements sequentially.

Linked list stores elements dynamically using nodes containing data and pointer.

Singly Linked List

Each node contains data and next pointer.

Last node next pointer = NULL

1 Efficient insertion/deletion
2 No random access

Circular Linked List

Last node points to first node instead of NULL.

Useful in round-robin scheduling

Doubly Linked List

Each node has previous and next pointer.

Allows bidirectional traversal

1 Faster deletion
2 More memory required

Stack

Stack follows LIFO (Last In First Out).

1 Push: insert element


2 Pop: remove element
3 Peek: view top element

Stack Algorithm

PUSH Algorithm: check overflow → increment top → insert element

POP Algorithm: check underflow → return element → decrement top

Stack ADT

Operations: create, push, pop, peek, isEmpty, isFull


Stack Applications

Used in recursion, expression evaluation, parenthesis matching, undo operations

Queue

Queue follows FIFO (First In First Out).

1 Enqueue: insert at rear


2 Dequeue: delete from front

Queue Algorithm

ENQUEUE: check overflow → insert at rear

DEQUEUE: check underflow → delete from front

Queue ADT

Operations: createQueue, enqueue, dequeue, front, isEmpty

Queue Applications

CPU scheduling

Printer spooling

Breadth First Search

Buffer management

You might also like