Data structure

Queue

Queue

Circular queue: Circular queue is the advanced version of the queue. In the circular queue, memory consumption is low. In this, front and rare of the queue is the same. An element can be added in the first place if it is empty. 

(II) Non-Linear data structure: In this type of data structure elements are arranged in a non-linear arrangement. The meaning of Non-linear arrangement is that elements will not assign memory in a sequence. In non-linear data structure memory utilization is effective because data is not assigned in a sequence, so it is scheduled in such a way so that memory could be utilized effectively. 

  1. Tree: Tree is a type of data structure where data are arranged in the root and branch form. These branches also have sub-branches. The root node is called the parent node and the branches are called the child node. The structure of a tree is hierarchical that forms the structure of the parent and the child. Tree is divided into different parts;

Root: Root is the topmost node in the tree hierarchy. The root node is the one that does not have any parent node.

Child node: If the node is a descendant of any node then this is called a child node.

Parent node: If any node contains any sub-nodes then this is called parent node.

Sibling: The nodes the have same parents is known as siblings.

Leaf node: If the node of the tree does not contain any child nodes then this is called leaf node.


Tree

 

  1. Graph: Graphs are types of data structures that consist of vertices and edges. A graph G = (V, E) consists of a set of vertices V = { V1, V2, . . . } and set of edges E = { E1, E2, . . . }.  The vertices are used for storing the data and edges show the relationship between the vertices. Graph is used in various real-life problems like telephone networks, circuit networks, Linkedin, Facebook, etc.

There are two types of graphs:

  • Directed graph: In a directed graph, edges form a path and are assigned with weights. In a directed graph, edges go only in one direction.
  • Undirected graph: In an undirected graph, edges are not assigned with the weights and it does not form any path.