Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

PLEASE USE C LANGUAGE

The objective is to be able to implement a graph data structure and graph traversals. 

1. Make a code for a program that follows the details in the PROGRAM SPECIFICATION section.
2. Develop a program following the structured programming approach at the very least. No global variable declarations are allowed. 


The program specifications are as follows:
Write a program that performs depth first search/traversal and breadth first search/traversal on predefined graphs.
(see the attached pictures for predefined graphs)

 

The graph search program will have the following main menu: 

Graph Traversal Program 

[1] Perform DFS Traversal 
[2] Perform BFS Traversal 
[3] Search Item using DFS 
[4] Search Item using BFS 
[0] Exit 

Enter choice: 


Details of the menu items are as follows: 

Perform DFS Traversal 
Once selected, the user is asked which graph to traverse. The program then performs depth-first search traversal and prints out the nodes in the order they are visited. 

Perform BFS Traversal 
Once selected, the user is asked which graph to traverse. The program then performs breadth first traversal and prints out the nodes in the order they are visited. 

Search Item using DFS 
Once selected, the user is asked what node to search and in which graph to search. The program then performs depth first search to search the node in the graph and prints a message stating if the node is part or not part of the graph. 

Search Item using BFS 
Once selected, the user is asked what node to search and in which graph to search. The program then performs breadth first search to search the node in the graph and prints a message stating if the node is part or not part of the graph. 

Exit 
Once selected, the program should terminate with a message informing the user that the program has ended. 


Note: At the end of each process, the program should display a message appropriate to the result of the process. After processing the selected main menu item, the program should loop back to the main menu. The program should end only when the user selects the main menu item Exit.

B
E
Graph 1
A
G
F
D
с
H
b
9
Graph 2
d
h
e
i
I
2
k
expand button
Transcribed Image Text:B E Graph 1 A G F D с H b 9 Graph 2 d h e i I 2 k
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education