Question: Write a heapsort program to: read in the data for Oklahoma universities, build the heap - sorting by the university name print the heap output

Write a heapsort program to: read in the data for Oklahoma universities, build the heap - sorting by the university name print the heap output the lines in alphabetical order build the heap - sorting by city print the heap output the lines in city order You can key in all of the data into a local file or you can cut and paste the data from the webpage. You may NOT change the data. Heap Sort - essential logic --------------------------- Pass 1 for i = 1 to n do top of loop read in ar[i] j = i while the jth item is not at the top && the j'th item is < its father top of loop swap the j'th item with its father set j to point to its father bottom of loop bottom of loop Pass 2 while n > 1 top of loop print the first item swap the last item with the first item decrement n set the father to point to the first slot calculate the location of the first son (s) while there is at least 1 son do top of loop if there are 2 sons then if the other son is smaller then point s to the other son if the father is smaller than the smaller son then set the control variable to exit the inner loop else swap ar[father] with ar[son] move the father down to the location of the smaller son recalculate the location of the first son bottom of loop bottom of loop 

Universities

Oklahoma State University - Stillwater Oklahoma State University Institute of Technology - Okmulgee Oklahoma State University System - Tulsa Mid-America Christian University - Oklahoma City Southeastern Oklahoma State University - Durant Cameron University - Lawton East Central University - Ada Oklahoma Christian University of Science & Arts - Oklahoma City Rogers State University - Claremore Rogers State University - Bartlesville Rogers State University - Pryor Langston University - Langston Langston University - Tulsa Langston University - Oklahoma City Northwestern Oklahoma State University - Enid Northwestern Oklahoma State University - Woodward Northwestern Oklahoma State University - Alva Oklahoma City University - Oklahoma City Oklahoma Panhandle State University - Goodwell University of Oklahoma Health Sciences Center - Oklahoma City Northeastern State University - Muskogee Northeastern State University - Broken Arrow Northeastern Oklahoma A&M College - Miami Northeastern State University - Tahlequah Oklahoma Wesleyan University - Bartlesville Oral Roberts University - Tulsa St. Gregory's University - Shawnee Southern Nazarene University - Bethany Southwestern Oklahoma State University - Weatherford University of Central Oklahoma - Edmond Oklahoma Baptist University - Shawnee University of Oklahoma - Norman University of Science & Arts of Oklahoma - Chickasha Bacone College - Muskogee OK University of Tulsa - Tulsa Connors State College - Muskogee Connors State College - Warner Northern Oklahoma College - Tonkawa Northern Oklahoma College - Stillwater Northern Oklahoma College - Enid University Center at Ponca City - Ponca City 

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!