C Programming C++

Operations in Data Structure

Operations : Data Structure

1. Operations on List Data Structure
Insertion : It is the process of inserting new element or data to a list. Inserting an element in lists is easier, as the place of insertion is known prior. An element can be inserted anywhere in the list.Image result for data structures and algorithms

2. Deletion : An element can be removed from the list by deletion process. While deleting the element care should be taken to modify the deleted element’s link since it would not be valid after deletion. Insertion and Deletion operations can be performed on linked lists.

3. Push: The Push operation is used on Stack data structure. A data is said to be ‘pushed’ in to the stack when the data is placed on the top of the stack that is adding the data at the top. All new datas are pushed in to the stack.

4. Pop: The pop operation is exactly opposite to the push operation. When the data at the top of the stack is removed, it is said to be ‘popped’. The data at the top of the stack only can be popped.

Operations on Trees

Tree Traversal : Traversing is a process of visiting every node in a tree at least once. The node is the part of the tree that contains the data. Before proceeding to the different traversals possible on trees.
A tree has two important parts are parent and child. The parent and child are all nodes. The top most node in the tree is the root.The root may grow in to many nodes called children.

There are three types of traversals in a tree. They are:

Inorder: The left node is visited first, then the root node is visited and finally the right node is visited.
Preoder: In preoder traversal, the nodes are visited in this fashion – root node, left node and right node.
Postorder: In postorder traversal, the nodes are visited in this fashion – left node, right node and root node.

Sorting and Searching

A list or tree is sorted to arrange the elements in an order so that the operations like traversal are done easily.
Generally the elements are sorted alphabetically.
The most commonly used search algorithms are sequential search and binary search.


One thought on “Operations in Data Structure”

Comments are closed.