CSCI 230 PROGRAM 4 solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Due
The due date is specified in the OAKS dropbox.
OBJECTIVES
• To implement search in an array.
• To implement binary search using iteration.
• To implement binary search using recursion.
• To implement linear search using iteration.
• To implement linear search using recursion.
PROGRAM REQUIREMENTS
PROGRAM SPECIFICATION
Application: Write an application that demonstrates linear search and binary search to the user of the application.
Write a test program called SearchTest. In that class do the following. Create an array of 100,000 Integer items, sorted in order
from lowest to greatest. You don’t have to do a sort if you create the sorted condition when originally filling the array with
numbers. Then present a menu to the user and produce output that is at least as good as this or better!
Pick a number between 1 and 100,000: 567
Found it in 0.003 seconds using binary search with iteration.
Found it in 0.023 seconds using binary search with recursion.
Found it in 0.032 seconds using linear search with iteration.
Found it in 0.051 seconds using linear search with recursion.
Implement the two search methods (iteratively and recursively) within a class called Search.java. Make the search methods
static so that they can be called without having to create an object of type Search. This is typical for math and math-like
algorithms.
Abstract Data Type:
Use an array of Integer that is 100,000 in length, storing values from 1 to 100000.
REFERENCES
None
GUI:
No GUI. Use the console for I/O.
PROGRAM DOCUMENTATION
Provide internal documentation only as required in the program documentation standard in OAKS.
Updates and clarifications to this assignment, if needed, will be done on Discussions.
PROGRAM SUBMISSION
Use the corresponding dropbox in OAKS using the same naming conventions as given in Program 1.