Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read it carfuly and give me the full code in c langhuge using heap application in C programming language, with the following tasks: Implement the

Read it carfuly and give me the full code in c langhuge using heap application in C programming language, with the following tasks:
Implement the required code to assist the 1st year students to find the shortest path between specific buildings using Dijkstra algorithm by reading the required information from the input_buildings.txt file, the file must initially have the information in the table below, but you can add more buildings and their distances in the file.
\table[[ direction,Masri,Aggad,A.Shaheen,Bamieh,AL.Juraysi,Alsadik,KNH,Sh.Shaheen],[Masri,,,70,39,,,155,78],[Aggad,,,,,71,52,43,],[A.Shaheen,,60,,,89,,,40],[Bamieh,,139,,,,,77,33],[AL.Juraysi,,,,,,,,],[Alsadik,,,,,57,,,],[KNH,,,,,67,,,],[Sh.Shaheen,,,,,120,140,104,]]
input_buildings.txt: contains for example contains some buildings, but you can add more buildings.
\table[[Masri#A.Shaheen#70],[A.Shaheen#Aggad#60]]
You must fill in the file with all distances between buildings.
Then you can use either contingency matrix or contingency list to represent the graph and store it in your program. The user inserts two buildings, then the application will find the shortest route between them, prints the total distance and the route between the two buildings.
2. Implement the required code to assist the 1st year students in computer engineering to sort the courses they must take using topological sort. The application must load the courses from the input_courses.txt file, where this file will contain the courses listed in the table below:
\table[[Course,Prerequisites],[COMP2310,COMP133],[COMP2421,COMP133],[COMP333,COMP2421],[COMP433,COMP333],[ENCS2340,COMP133],[ENCS2380,ENCS2340],[ENCS3130,COMP133],[ENCS3310,ENCS2380],[ENCS3340,COMP233 and COMP133],[ENCS4320,COMP233 and COMP133]]
input_courses.txt: contains the list of courses and their pre-requisite, below is an example.
COMP2310# COMP133
ENCS3340# COMP233# COMP133
You have to fill in the file with all courses and their pre-requisites .
Upon request, the application sorts the courses using topological sort and saves them internally in the program. So, the user can print them on request.
Your application must have the following menu:
Load the two files.
Calculate the shortest distance between two buildings.
Print the shortest route between two buildings and the total distance.
Sort the courses using the topological sort.
Print the sorted courses.
Exit the application.
image text in transcribed

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Differentiate sin(5x+2)

Answered: 1 week ago

Question

Compute the derivative f(x)=1/ax+bx

Answered: 1 week ago

Question

Address an envelope properly.

Answered: 1 week ago

Question

Discuss guidelines for ethical business communication.

Answered: 1 week ago