subject

For this assignment you have to write a C program that will utilize the merge sort and binary search algorithm. Problem In this assignment, you have to read a text file (in. txt) that contains a set of point coordinates (x, y). The first line of the file contains the number of points (N) and then each line of the file contains x and y values that are separated by space. The value of x and y are integer. They can be both negative and positive numbers. You have to sort those points in x-axis major order and then write the output into another file (out. txt) in the same format, i. e., each line contains one coordinate point and the value of x and y are space delimited. After writing the sorted points in the file, your program should display "sorted and output written". After that your program should prompt the user for an input coordinate point x and y values and your program should perform binary search to determine whether the point exist in the given list of points. If it is found, it should show "Found at record number ". If not, say not found. Sample Input file in. txt: 6 3 4 6 2 5 2 7 5 2 Sample Input file out. txt: 2 5 2 7 4 6 5 2 6 3 "Sorted and output written" Search input (x y): 2 3 Output: Not found Search input (x y): 4 6 Output: Found at record 3 Requirement: You must use file IO, Merge sort and binary search for your solution.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:40
Write c function that can replace all the positive elements to 0 and negative to 1 in undefined length one-dimensional array. test your program in the main program by defining one-dimensional array of 6 elements
Answers: 1
question
Computers and Technology, 21.06.2019 22:00
You should try to photograph people on bright sunny days because the light will be best a) true b) false
Answers: 1
question
Computers and Technology, 22.06.2019 11:20
The kurt vonnegut commencement speech, the neiman-marcus chocolate chip cookie recipe, and the get-well emails to the dying boy are examples of select one: a. social engineering b. hoax emails c. email viruses d. worms
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
You know the right answer?
For this assignment you have to write a C program that will utilize the merge sort and binary search...
Questions
question
Mathematics, 17.04.2020 02:05
Questions on the website: 13722360