Title:
modified_search_ordered_array Download
Description: Problem Statement:
Given an ordered array A[1, n] of n ≥ 1 integers with A[1] ≤ A[2] ≤ · · · ≤ A[n], and an
integer x the problem is to determine integer i, 0 ≤ i ≤ n, such that
1) 1 ≤ i ≤ n and i is the largest index such that x ≥ A[i], and
2)i = 0 if there is no such index.
Prologue: The source code implements modified search in an ordered array given as the input. It gives the resultant index as the output and number of comparisons made.
Overview: The program uses the file descriptors to take input array from input file and to give the resultant index and comparisons onto an output file.
To Search:
File list (Check if you may need any files):
msearch.c
mBsearch.c