Professional Documents
Culture Documents
DS Outsidin Chapter 2
DS Outsidin Chapter 2
Overview
Linear
Non-linear
Linear structures
List
Ordered List
Unordered List
Queue
Stack
Trees:
10
Tree
11
Not Tree
12
Binary Tree
13
A Binary Tree
14
General Tree
15
16
17
AVL Tree
18
19
20
Heap
21
Hash Table:
23
Graphs
Graph: A data structure that consists of a set of models and a set of edges
that relate the nodes to each other
24
Graphs
25
27
Data Type
32
34
35
37
38
push
pop
get-Size
isEmpty
39
40
Reuse by inheritance.
41
42
43
Example
A data structure with the best interface with the best fit
may not necessarily be the best overall fit, if the running
times of its operations are not up to the mark.
When we have more than one data structure
implementation whose interfaces satisfy our
requirements, we may have to select one based on
comparing the running times of the interface operations.
Time is traded off for space,
45
Time-space tradeoff
i.e. there is not single operation that a client can use to get the
number of entries in StackA.
46
Three situations:
47
48
49
50
51