Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

?PLEASE CODE IN C AND DISPLAY YOUR OUTPUT! THANK YOU IN ADVANCE! CS 2123-001 Data Structures Instructor Dr. Turgay Korkmaz Homework 6 Due date: check

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed?PLEASE CODE IN C AND DISPLAY YOUR OUTPUT! THANK YOU IN ADVANCE!

CS 2123-001 Data Structures Instructor Dr. Turgay Korkmaz Homework 6 Due date: check BB Learn !!!NO LATE HOMEWORK WILL BE ACCEPTED!! (Graphs graph functions) You are given the basic code that we implemented in the slides to create/read/print graphs. First copy/paste it into a file say graph.c and compile/run it gcc graph.c-o graph > ./graph graph filename For sample graphs, again copy/paste the below graph data into a file undirectedgraph1.txt and directedgraph1.txt then run your program a:s ./graph undirectedgraph1.txt > ./graph directedgraphl.txt directedgraph1.txt 6 8 1 1 2 3 2 3 1 3 1 6 3 5 2 4 2 5 4 5 3 4 6 6 undirectedgraphl.txt 1 2 3 1 3 6 3 5 2 4 5 3 4 6 6 5 6 1 After studying and understanding the given code, first modify insert edge) function so that it can keep the link list sorted w.r.t. neighbor IDs. Second implement graph_copy) to create a copy of the given graph. User will call the original graph as myg1 and the copy as myg2, for which we use the same pointer names in the program. Now extend the main function so that it can asks user to enter various commands in a loop and performs these commands on the related graphs. Accordingly you also need to implement those functions and call them. Finally when ending the main function, make sure you free the graphs -- see more explanations that are at the end of this handout--.....-.- CS 2123-001 Data Structures Instructor Dr. Turgay Korkmaz Homework 6 Due date: check BB Learn !!!NO LATE HOMEWORK WILL BE ACCEPTED!! (Graphs graph functions) You are given the basic code that we implemented in the slides to create/read/print graphs. First copy/paste it into a file say graph.c and compile/run it gcc graph.c-o graph > ./graph graph filename For sample graphs, again copy/paste the below graph data into a file undirectedgraph1.txt and directedgraph1.txt then run your program a:s ./graph undirectedgraph1.txt > ./graph directedgraphl.txt directedgraph1.txt 6 8 1 1 2 3 2 3 1 3 1 6 3 5 2 4 2 5 4 5 3 4 6 6 undirectedgraphl.txt 1 2 3 1 3 6 3 5 2 4 5 3 4 6 6 5 6 1 After studying and understanding the given code, first modify insert edge) function so that it can keep the link list sorted w.r.t. neighbor IDs. Second implement graph_copy) to create a copy of the given graph. User will call the original graph as myg1 and the copy as myg2, for which we use the same pointer names in the program. Now extend the main function so that it can asks user to enter various commands in a loop and performs these commands on the related graphs. Accordingly you also need to implement those functions and call them. Finally when ending the main function, make sure you free the graphs -- see more explanations that are at the end of this handout

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

2. Identify four types of migrant groups.

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago