Overview of Data Structure: Data Structures and Algorithms
Overview of Data Structure: Data Structures and Algorithms
• Stack contains two operation push and pop. Push is used to insert an element
into stack and pop is used to remove an element from stack. The following figure
shows the two operations how it is performed in stack. It is also called as last- in
first- out (LIFO), because the element pushed last need to be popped out first.
Queue
• It is a linear list in which insertion and deletion will take place in
different end.
• As shown in figure below the end where we insert an element is
called the “rear” end and deletion at “front” end.
• The element entered first need to be removed first, so it is also called
as first- in first- out (FIFO).
Trees
• Tree is a nonlinear data structure which contains the hierarchical
relationship between various elements is called a tree.
• One node is distinguished as a root, every other node is connected by
a directed edge from exactly one other node, with the direction of
parent -> children.
Graph
• Data sometimes contain a relationship between pairs of elements
which is necessarily hierarchical in nature. The data structure referred
in figure below reflects this type of relationship is called a graph.
Applications of Data Structure
• Traversal: Travel through the data structure, travelling salesman problem,
shortest path problem.
• Search: Traversal through the data structure for a given element,
appropriate searching methodology, searching a number from thousands
of random numbers.
• Insertion: Adding new elements to the data structure, constructing index
tree, B-tree, insertion of elements into the sorted database.
• Deletion: Removing an element from the data structure, garbage
collection, memory utilization and optimization.
• Sorting: Arranging the elements in some order, appropriate sorting
method for appropriate architecture.
• Merging: Combining two similar data structures into one