0% found this document useful (0 votes)
5 views

Data_Structures_Class_Notes

The document provides an overview of fundamental data structures in algorithms, including arrays, linked lists, stacks, queues, trees, hash tables, and graphs. Each structure is described with its advantages, disadvantages, types, and common applications. Key operations and characteristics are also highlighted for each data structure.

Uploaded by

Shagufta Anjum
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)
5 views

Data_Structures_Class_Notes

The document provides an overview of fundamental data structures in algorithms, including arrays, linked lists, stacks, queues, trees, hash tables, and graphs. Each structure is described with its advantages, disadvantages, types, and common applications. Key operations and characteristics are also highlighted for each data structure.

Uploaded by

Shagufta Anjum
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
You are on page 1/ 3

Algorithms Class Notes

1. Arrays and Strings

Arrays are fixed-size collections of elements of the same type.

Advantages:

- Fast access (O(1))

- Efficient memory usage

Disadvantages:

- Fixed size

- Costly insertions/deletions

Strings are arrays of characters, often with special handling in many languages.

2. Linked Lists

Linked List is a linear data structure where each element points to the next.

Types:

- Singly Linked List

- Doubly Linked List

- Circular Linked List

Advantages:

- Dynamic size

- Easy insertion/deletion

Disadvantages:

- Sequential access

- Extra memory for pointers


Algorithms Class Notes

3. Stacks and Queues

Stacks: LIFO (Last-In-First-Out)

- Operations: push, pop, peek

- Applications: recursion, undo functionality

Queues: FIFO (First-In-First-Out)

- Operations: enqueue, dequeue

- Types: Circular Queue, Priority Queue

- Applications: scheduling, buffering

4. Trees

Trees are hierarchical data structures with nodes.

Types:

- Binary Tree

- Binary Search Tree (BST)

- AVL Tree (self-balancing)

- Heap (Max/Min)

Operations: insertion, deletion, traversal (inorder, preorder, postorder)

5. Hash Tables

Hash Tables store key-value pairs using a hash function.

Advantages:

- Fast lookups (average O(1))


Algorithms Class Notes

Challenges:

- Collisions (handled by chaining or open addressing)

Applications: dictionaries, caching, databases

6. Graphs

Graphs consist of vertices (nodes) and edges.

Can be directed/undirected, weighted/unweighted.

Representations:

- Adjacency Matrix

- Adjacency List

Applications: social networks, web page linking, navigation

You might also like