Data Structure 2
Data Structure 2
•Graphs
•Arrays •Trees
•Linked Lists •Tries
•Stacks •Maps
•Queues
What is an Array?
f
bool false
b
o
o
a
l
s
l
e
char 0
c
h
0
a
r
int 0
i
n 0
t
float 0.0
f
l 0
o .
a 0
t
double 0.0f
d
o 0
u .
b 0
l f
void e
v
o
i
wchar_t 0
d
w
c
h
a 0
r
_
t
Basic Operations in Arrays
• Traverse − print all the array elements one by one.
• Insertion − Adds an element at the given index.
• Deletion − Deletes an element at the given index.
• Search − Searches an element using the given index or
by the value.
• Update − Updates an element at the given index.
• Display − Displays the contents of the array.
Array - Insertion Operation