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

Data Structures Course Outline Notes

The document outlines a course on Data Structures, covering definitions, types (linear and non-linear), and key concepts such as abstraction and abstract data types. It includes specific data structures like arrays, stacks, queues, linked lists, trees, heaps, hashing, and graphs, along with C++ code examples for each. Additionally, it addresses memory management and garbage collection in programming.

Uploaded by

Mustafa Attlera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Data Structures Course Outline Notes

The document outlines a course on Data Structures, covering definitions, types (linear and non-linear), and key concepts such as abstraction and abstract data types. It includes specific data structures like arrays, stacks, queues, linked lists, trees, heaps, hashing, and graphs, along with C++ code examples for each. Additionally, it addresses memory management and garbage collection in programming.

Uploaded by

Mustafa Attlera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Data Structures - Course Outline

Notes
Simplified Notes with C++ Code
Examples
Introduction to Data Structures
• Definition: A data structure is a way to
organize and store data efficiently.
• Types: Linear (e.g., arrays, linked lists) and
Non-linear (e.g., trees, graphs).
Linear and Non-Linear Data
Structures
• Linear: Array, Stack, Queue, Linked List.
• Non-Linear: Tree, Graph.
Static and Dynamic Data Structures
• Static: Size is fixed (e.g., array).
• Dynamic: Size can change (e.g., linked list).
Abstraction and Abstract Data
Types (ADT)
• Abstraction: Hiding complex details, showing
only essential features.
• ADT: Data structure defined by behavior (e.g.,
Stack with push/pop).
Arrays and Operations
• Definition: Collection of items stored at
contiguous memory locations.
• Operations: Accessing elements, updating
values, and iteration.
• C++ Code:
• #include <iostream>
• using namespace std;

• int main() {
Stack (LIFO) and Queue (FIFO)
• Stack:
• Operations: Push, Pop, Peek.
• C++ Code:
• #include <iostream>
• #include <stack>
• using namespace std;

• int main() {
• stack<int> s;
Linked Lists
• One-way Linked List: Nodes are connected in
one direction.
• C++ Code:
• #include <iostream>
• using namespace std;

• struct Node {
• int data;
• Node* next;
Trees
• Binary Tree: Each node has a maximum of two
children.
• C++ Code:
• #include <iostream>
• using namespace std;

• struct Node {
• int data;
• Node* left;
Polish Notation (Prefix, Postfix)
• Prefix: Operators are before operands, e.g.,
+AB.
• Postfix: Operators are after operands, e.g.,
AB+.
Heaps
• Definition: A special Tree-based data structure
that satisfies the heap property.
• Heap Sort: Sorting technique using heap
properties.
Hashing
• Definition: Mapping data to a unique index.
• Applications: Hash tables.
• C++ Code:
• #include <iostream>
• #include <unordered_map>
• using namespace std;

• int main() {
• unordered_map<string, int> hash_table;
Graphs
• Definition: Collection of nodes connected by
edges.
• Types: Directed, Undirected.
Memory Management and
Garbage Collection
• Memory Management: Process of managing
memory allocation.
• Garbage Collection: Reclaims memory from
objects no longer in use.
• C++ Code:
• int* ptr = new int; // Allocate memory
• delete ptr; // Free memory

You might also like