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
a. Explain the sum of subset problem. Apply backtracking to solve the following instance of sum of subset problem: w= (3, 4, 5, 6} and d = 13. Briefly define the method using a sta

HEAP  A heap is described to be a binary tree with a key in every node, such that  1-All the leaves of the tree are on 2 adjacent levels. 2- All leaves on the lowest leve

Create a Money data structure that is made up of amount and currency. (a) Write a constructor for this data structure (b) Create accessors for this data structure (c) Writ

Determine about the Post conditions assertion A  post condition is an assertion which should be true at completion of an operation. For instance, a post condition of the squ

Readjusting for tree modification calls for rotations in the binary search tree. Single rotations are possible in the left or right direction for moving a node to the root position

perform the following length operation LENGTH("welcome to ICA")=

Overlapping or Intersecting A polygon overlaps or intersects the current background if any of its sides cuts the edges of the viewport as depicted at the top right corner of th

Example of Area Subdivision Method The procedure will be explained with respect to an illustrative problem, with the image consisting of five objects, namely a triangle (T), qu

1. In computer science, a classic problem is how to dynamically store information so as to let for quick look up. This searching problem arises frequently in dictionaries, symbol t

write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a