Trees
1
Trees
Binary Trees
Tree Traversal
2
1. Binary Trees
A Tree is a non-linear, hierarchical one-to-
many data structure.
A special tree is the
Binary Tree
a
b
d
c
e
f
g
3
Binary Trees
Can be implemented using arrays, structs
and pointers
Used in
CS214: Data Structures 2016
Project-phase 2: 4.5 + 1.5 bonus marks
Cairo University, Faculty of
Computers and Information
Phase 2: Deadline & Submission (The the details on page 5)
1. At least one team member should submit the compressed group
solution as
Data Structures and Algorithms
Graphs
1
Graphs
Basic Definitions
Paths and Cycles
Connectivity
Other Properties
Representation
Examples of Graph Algorithms:
Graph Traversal
Shortest Paths
Minimum Cost Spanning Trees
2
1. Basic Definitions
A graph G
Binary Search Trees
1
Binary Search Trees
The Binary Search Tree (BST)
Search, Insertion and Traversal of BST
Removal of nodes from a BST
Binary Search Tree ADT
Template Class Specification
Other Search Trees (AVL Trees)
2
The Binary Search Tree (BST)
v
u
Data Structures and Algorithms
Elementary Data Structures
1
Elementary Data Structures
Static and Dynamic Data Structures
Static Arrays
Pointers
Run-Time Arrays
The Linked List Structure
Some Linked List Operations
Variations on Linked Lists
2
1. S
Data Structures and Algorithms
Stack
1
The Stack ADT
Introduction to the Stack data
structure
Designing a Stack class using
dynamic arrays
Linked Stacks
Some Applications of Stacks
2
1. Introduction to the Stack
Data Structure
A simple data container con
Name :
ID:
Mid-Term Exam, CS505
Data Structures
Assume that you have
following definition:
the following doubly Linked List class DList with the
template <class keyType, class dataType>
class DList
cfw_
public:
List();
~List();
bool listIsEmpty() const;
b
Data Structures and Algorithms
Linked List
1
Lists
The Linked List
ADT Linked List
The Linked List Class Definition
Linked List Class implementation
Example Application
2
2. The Linked List
Linked List Abstraction:
Linked List: a container of data in
Data Structures and Algorithms
Heap Tree
1
What is a heap
1. It is a complete binary tree; that is, each level of
the tree is completely filled, except possibly the
bottom level. At this level, it is filled from left to
right.
2. It satisfies the heap-ord
Data Structures and Algorithms
Queue
1
The Queue ADT
Introduction to the Queue data structure
Designing a Queue class using dynamic
arrays
Linked Queues
An Application of Queues
2
1. introduction to the Queue
Data Structure
A simple data container consis
CS214: Data Structures 2016
Assignment 1: 5 marks
Cairo University, Faculty of
Computers and Information
Deadline & Submission
1. At least one team member should submit the compressed group solution as zip file
containing the programs and report under aca