Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a directed graph G=(V,E) using Adjacency List Method. here V is a set of vertices and E is a set of ordered pairs of

Create a directed graph G=(V,E) using Adjacency List Method. here V is a set of vertices and E is a set of ordered pairs of vertices called edges. An edge(i,j) is directed from i to j.

image text in transcribed

Task 1: Create a directed graph G (VE) using Adjacency List method. Here V is a set of vertices and E is a set of ordered pairs of vertices called edges. An edge(i) is directed from 1 to Design and implement a graph class using the adjacency list method as explained in the class lecture. The nodes should store strings The class should have the following methods fully implemented. i. ii. 111. iv. v. vi, vii. Constructor - This should have an overload indicating the number of vertices in the graph. addNode(i) - adds a node to the graph. i is the value stored in the node addEdge(LJ)-Add the edge (ij) to E. removeEdge(LJ)-Remove the edge (ij) from E removeNode(i) - Removes the node from the graph. hasEdge(LJ)-Check if the edge (LJ) E E. outEdges(i) - Return a list of all integers j such that edge (ij)E E. viii. inEdges(i) - Return a list of all integers j such that edge (j.i) E E ix. Destructor Task 1: Create a directed graph G (VE) using Adjacency List method. Here V is a set of vertices and E is a set of ordered pairs of vertices called edges. An edge(i) is directed from 1 to Design and implement a graph class using the adjacency list method as explained in the class lecture. The nodes should store strings The class should have the following methods fully implemented. i. ii. 111. iv. v. vi, vii. Constructor - This should have an overload indicating the number of vertices in the graph. addNode(i) - adds a node to the graph. i is the value stored in the node addEdge(LJ)-Add the edge (ij) to E. removeEdge(LJ)-Remove the edge (ij) from E removeNode(i) - Removes the node from the graph. hasEdge(LJ)-Check if the edge (LJ) E E. outEdges(i) - Return a list of all integers j such that edge (ij)E E. viii. inEdges(i) - Return a list of all integers j such that edge (j.i) E E ix. Destructor

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions