Question: ?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

?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 slidesto create/read/print graphs. First copy/paste it into a file say graph.c andcompile/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.txtthen run your program a:s ./graph undirectedgraph1.txt > ./graph directedgraphl.txt directedgraph1.txt 6?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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!