MSA Data Structure Presentation
MSA Data Structure Presentation
TREE: It is a finite data items (nodes) in which data items are arranged in
branches and sub branches. Tree represent the hierarchical relationship
between various elements.
◦ Every item is related to its previous and next ◦ Every item is attached with many other items.
item. ◦ Data is not arranged in sequence.
◦ Data is arranged in linear sequence.
◦ Data cannot be traversed in a single run.
◦ Data items can be traversed in a single run
◦ E.g. Tree, Graph
◦ E.g. Array, Stacks, Linked list, Queue
◦ Implementation is difficult.
◦ Implementation is easy.
Operation on Data Structures
Design of efficient data structure must take operations to be performed on the DS into account. The most commonly
used operations on DS are broadly categorized into following types
1. Create: This operation results in reserving memory for program elements. This can be done by declaration
statement Creation of DS may take place either during compile-time or run-time.
2. Destroy: This operation destroy memory space allocated for specified data structure .
3. Selection: This operation deals with accessing a particular data within a data structure.
4. Updation: It updates or modifies the data in the data structure.
5. Searching: It finds the presence of desired data item in the list of data items, it may also find locations of all
elements that satisfy certain conditions.
6. Sorting: This is a process of arranging all data items in a DS in particular order, for example either ascending order
or in descending order.
7. Splitting: It is a process of partitioning single list to multiple list.
8. Merging: It is a process of combining data items of two different sorted list into single sorted list.
9. Traversing: It is a process of visiting each and every node of a list in systematic manner.
What are Arrays?
Syntax
arrayName[indexNum]
Example
balance[1]
Here, we have accessed the second value of the array using its index, which is 1.
The output of this will be 200, which is basically the second value of the balance
array.
◦ Array Representation
◦ Arrays can be declared in various ways in different languages. For illustration, let's take C array declaration.