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
Define Dynamic Programming  Dynamic  programming  is  a  method  for  solving  problems  with  overlapping  problems.  Typically, these sub problems arise from a recurrence rel

Before programming a problem solution those employees a stack, we have to decide how to represent a stack by using the data structures which exist in our programming language. Stac

Consider the digraph G with three vertices P1,P2 and P3 and four directed edges, one each from P1 to P2, P1 to P3, P2 to P3 and P3 to P1. a. Sketch the digraph. b. Find the a

Write an assembly program to separate the number of positive numbers and negative numbers from a given series of signed numbers.

explain two strategies to implement state charts with the help of an example of each.

In the present scenario of global warming, the computer hard ware and software are also contributing for the increase in the temperature in the environment and contributing for the

Q. How can we free the memory by using Boundary tag method in the context of Dynamic memory management?

whate is meant by the term heuristic

What is binary search?   Binary search is most useful when list is sorted. In binary search, element present in middle of the list is determined. If key (the number to search)

Description A heap is an efficient tree-based data structure that can be used as a priority queue. Recall that the abstract data type of a priority queue has the following opera