Question: CSE 3318 Lab Assignment 1 Due September 14 Goal: Application of binary searches to determine (in a logarithmic number of steps) which element in a

 CSE 3318 Lab Assignment 1 Due September 14 Goal: Application ofbinary searches to determine (in a logarithmic number of steps) which element

CSE 3318 Lab Assignment 1 Due September 14 Goal: Application of binary searches to determine (in a logarithmic number of steps) which element in a pair of monotonically increasing (i.c. non-decreasing) sequences has a particular rank. Requirements: 1. a. Write a C program to read two ordered integer input sequences and then a sequence of ranks (queries). For each rank you should trace the binary search (one line per \"probe\") and then indicate which element of which sequence has the desired rank. The rst line of the input le will give m, n, and p where m is the number of elements in the rst sequence, 11 is the number of elements in the second sequence, and p is the number of ranks (queries) for which binary searches will be performed. The integer input sequence elements will be in the range 0 . . . 999,999, inclusive. The ranks will be in the rangel...m + n. b. The output line for each 9(1) time probe should include the values of low, high, i, and j. (Note that i serves the role of \"mid\" for the binary searches). You may also include other debugging information, such as the result of the probe. Submit your C program on Canvas by 5:00 pm on Thursday, September 14. Comments at the beginning of the source le should include: your name, your ID number, and the command used to compile your code on Omega (5 point penalty for non-compliance). Getting Started: 1. Your program should read the input les via Linux shell redirection (e.g. a . out

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 Programming Questions!