Reverse order of elements on a slack, Data Structure & Algorithms

Q. Describe the representations of graph. Represent the graph which is given to us using any two methods

2085_Representation of graph.png

Ans:

The different ways by which we can represent graphs are:

Adjacency list representation: In this representation of graph there is an array Adj of |V| lists, one for each vertex in V. For each uεV, the adjacency list Adj[u] contains all the vertices v such that there is an edge (u,v)ε E that is Adj[u] consists of all the vertices adjacent to u in G. The vertices in each and every adjacency list are stored in an arbitrary order. The adjacency list representation of given graph is shown in the following figure:

504_Representation of graph1.png

Adjacency Matrix representation: This representation consists of the |V|*|V| matrix

A=(aij) such that

448_Representation of graph2.png

The adjacency matrix representation of given graph is as follows

1545_Representation of graph3.png

Posted Date: 7/10/2012 3:18:02 AM | Location : United States







Related Discussions:- Reverse order of elements on a slack, Assignment Help, Ask Question on Reverse order of elements on a slack, Get Answer, Expert's Help, Reverse order of elements on a slack Discussions

Write discussion on Reverse order of elements on a slack
Your posts are moderated
Related Questions
How memory is freed using Boundary tag method in the context of Dynamic memory management? Boundary Tag Method to free Memory To delete an arbitrary block from the free li

algorithm for multiplication of two sparse matrices using link list

Conversion of Forest into Tree A binary tree may be used to show an entire forest, since the next pointer in the root of a tree can be used to point to the next tree of the for

SPARSE MATRICES Matrices along with good number of zero entries are called sparse matrices. Refer the following matrices of Figure (a)

Q. Explain the basic concept of the primitive data structures.                                             Ans. The concept of P r i m i t i ve Data

GIVE TRACE OF BINARY SEARCH ALGORITHM BY USING A SUITABLE EXAMPLE.

Illustrates the program segment for Quick sort. It uses recursion. Program 1: Quick Sort Quicksort(A,m,n) int A[ ],m,n { int i, j, k; if m { i=m; j=n+1; k

Explain binary search with an example

1)      Why space complexity is comparatively more critical than time complexity? 2)      Determine the space complexity of Euclid Algorithm?

Each data record contains a fixed place in a relative file. Each record ought to have associated with it in integer key value which will help identify this slot. Therefore, this ke