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
The Linked list is a chain of structures wherein each structure contains data in addition to pointer, which stores the address (link) of the next logical structure in the list.

how to convert 12 hour format into 24 hour format using c program

Algorithm for insertion of any element into the circular queue: Step-1: If "rear" of the queue is pointing at the last position then go to step-2 or else Step-3 Step-2: make

Arrays are simple, however reliable to employ in more condition than you can count. Arrays are utilized in those problems while the number of items to be solved out is fixed. They

Determine YIQ Colour Model Whereas an RGB monitor requires separate signals for the red, green, and blue components of an image, a television monitor uses a single composite si

CMY Model  The cyan, magenta, yellow (CMY) colour model is a subtractive model based on the colour absorption properties of paints and inks. As such it has become the standard

Q. What do you understand by the tree traversal? Write down the procedure for traversing a binary tree in preorder and execute it on the following tree.    Ans: Th

A graph with n vertices will absolutely have a parallel edge or self loop if the total number of edges is greater than n-1

how can i delete from deque while deletion is restricted from one end

Instructions Design and test a reference array. Reference array stores the references to user supplied objects of different types. Just think it as a heterogeneous array wh