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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:00, Albertrami9019
Jill wants to become a network professional. which certification would be useful for her? a. mcse b. pmp c. comptia a+ d. ccie
Answers: 2
image
Computers and Technology, 22.06.2019 20:10, ianmartin6080
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, suewignall
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from it’s socket
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, studybug2306
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
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 in other subjects:

Konu
Mathematics, 29.08.2019 20:30
Konu
Mathematics, 29.08.2019 20:30
Konu
Biology, 29.08.2019 20:30