Professional Documents
Culture Documents
CHAPTER 2
Data structures Basics
By: DHANISH E
They are the data types which are derived from the
primitive data type. They are slightly complex then the
primitive.
They can be homogeneous and heterogeneous.
▪ Data Search
▪ Processor speed
▪ Multiple requests
The basic operations that are performed on data structures are as follows:
Deletion: Deletion means removal of a data element from a data structure if it is found.
Searching: Searching involves searching for the specified data element in a data structure.
Traversal: Traversal of a data structure means processing all the data elements present in it.
Sorting: Arranging data elements of a data structure in a specified order is called sorting.
Merging: Combining elements of two similar data structures to form a new data structure of
the same type, is called merging.
“An abstract data structure or type "is defined indirectly, only by the
operations that may be performed on it and by mathematical constraints
on the effects (and possibly cost) of those operations."
A list contains elements of same type arranged in sequential
order and following operations can be performed on the list.
get() – Return an element from the list at any given position.
insert() – Insert an element at any position of the list.
remove() – Remove the first occurrence of any element from a
non-empty list.
removeAt() – Remove the element at a specified location from a
non-empty list.
replace() – Replace an element at any position by another
element.
size() – Return the number of elements in the list.
isEmpty() – Return true if the list is empty, otherwise return false.
isFull() – Return true if the list is full, otherwise return false.
Step 1 − START
Step 2 − declare three integers a, b & c
Step 3 − define values of a & b
Step 4 − add values of a & b
Step 5 − store output of step 4 to c
Step 6 − print c
Step 7 − STOP
step 6 − print c
step 7 − STOP
````````````````````
START ADD
get values of a & b
c←a+b
display c
STOP
Thank you