You are on page 1of 6

DATA STRUCTURE GLOSSARY

Submitted By: Mohit Singh 1.Adjacency Matrices It is the representation of graph which shows that which of the vertices of the graph is adjacent to which of the other vertex. This matrix representation indicates that vertex v1 is adjacent to vertex v2 or v1 is not adjacent to v2. Both rows and columns of the matrix are indexed with the vertices and the adjacency
matrix of a finite graph G of n vertices is the n x n matrix where aij is the number of edges from vertex i to vertex j. v1 v2 v3 v4 v5 v6

where the entry at a(i,j) is 1 if there is an edge vertex i to vertex j, otherwise the entry is 0.

from

2.Adjacency List It is the representation of all the edge of the graph as a list. The edges are stored as array of list indicating both source node and destination node. Source Node Dest. node

1 { 1, 2, 5} 2 { 1, 3, 5} 3 { 2, 4} 4 { 3, 5, 6} 5 { 1, 2, 4} 6 { 4 }

3.Depth First Search Depth first search (DFS) is the ways to traverse (visit all the nodes) of a graph systematically which give us the information about graphs connectedness DFS progressed by expanding the first node of the graph and going deeper and deeper until it hits a node that has no children. Then the search backtracks, returning to the most recent node it hasn't finished exploring. To do this properly we need to keep track of which vertices have already been visited, plus how to backtrack, all freshly expanded nodes are added to the stack data structure for exploration. 4.Breadth First Search Breadth first search (BFS) is a graph search algorithm that begins at the starting node and explores all the neighboring nodes. Then for each of those nearest nodes, it explores their unexplored neighbor nodes, and so on, until it finds the goal. i.e. the graph is expanded from left to right. 5.Spanning Trees Spanning tree of a graph is defined as the part of the graph or as tree that contains all the nodes/ vertices of the graph without having any cycle

6. Searching Computer systems stores large no of data. Searching refers to the process of finding the location of an ITEM in the storage. The search is said to be successful if it appears in the storage, otherwise the search is unsuccessful. Searching is categorized into: 1. Internal search. 2. External search.

Internal search means searching data which resides in files stored on disk and external search means searching data which resides in main memory. Types of search algorithm used are: 1. Linear search / Sequential search. 2. Binary search.

7. Sequential search As the name indicates, this search technique searches for an element in the collection of elements (array, linked list, stack), starting from the first element to the last. Suppose there are n elements, and no other information is given about the collection. The most common way to search a given ITEM is to compare it with each element of the collection one by one starting from the first element to the last. Each element is accessed once sequentially. Disadvantage: It is very slow method and can only be used for small data.

8. Binary Search The main disadvantage of sequential search technique is that it is inefficient for large amount of data. Hence it is only used for small amount of data. If the data are stored in increasing order, binary search can be used efficiently to find the location of an ITEM by comparing it with the middle element rather then with the first element, if there is a match the item is returned immediately, if the ITEM is less then the middle element, the ITEM might lie in the lower half of the list otherwise in the upper half of the list. Hence the procedure is repeated on the lower /upper half of the list. Disadvantage: This method can only be used if elements are arranged in increasing order.
9. Sorting

It is the process of arranging the data in some order (increasing /decreasing), which helps in accessing the data more efficiently. For example it is inefficient to find a word in the dictionary if they are not ordered alphabetically.

10. Internal Sorting Internal sorting is the sorting process that takes place in main memory. It is used for small amount of information, so that the sorting process can be completed in the main memory itself. 11. External Sorting

In comparison to the internal memory, external memory is used for large amount of data, which resides in the external memory/ secondary memory. 12. BST Binary search tree (BST) is a type of binary tree where the nodes are arranged in such a way that, Value of root node > value of leftmost child > value of right child, this helps in finding a node efficiently in comparison to the ordinary binary tree.

(A binary search tree of size 9 and depth 3, with root 8 and leaves 1, 4, 7 and 13)

13. B Trees B Tree is perfectly height balanced m-way search tree. A B tree is a m- way search tree with the following properties. 1. It is perfectly balanced (i.e. every leaf node is at the same depth) 2. Every node , except perhaps the root node , is half full. Example: 4 way B tree

maximum no of values in a node = m-1= 4-1 =3 No of sub trees = m = 4 Root node can contain 1 to m-1 values Other nodes must at least

14. AVL trees These are also known as Height Balanced Binary Search Tree, if each node possesses one of the following properties: For every node n in the tree,
1. The node is said to be left heavy, if the length of left sub tree can be one longer then the length of its right sub tree. 2. The node is said to be right heavy, if the length of right sub tree can be one longer than the length of its left sub tree. 3. The node is said to be balanced, if the height of the left sub tree and right sub tree are equal. The value of the balance factor of any node is -1, 0, and 1. If it is other than the tree is not balanced or it is not an AVL tree. Where balanced factor is defined as: Balanced factor = height of left sub tree height of right sub tree.

Example:

Balance factor of node A: height of left sub tree height of right sub tree= 1-1=0. Balance factor of node B: height of left sub tree height of right sub tree= 0-0=0. Balance factor of node C: height of left sub tree height of right sub tree= 0-0=0. A A C Balance factor of node A: height of left sub tree height of right sub tree= 0 - 1 =-1. Balance factor of node C: height of left sub tree height of right sub tree= 0 - 0 =0.

15. What is B+ tree?

16. Explain Linked representation of adjacency matrix.

You might also like