Ecet 370 Week 4 Lab 4 Complexity of Computational Problems

Submitted by: Submitted by

Views: 10

Words: 2563

Pages: 11

Category: Other Topics

Date Submitted: 03/13/2016 11:57 PM

Report This Essay

ECET 370 Week 4 Lab 4 Complexity of Computational Problems

Purchase ECET 370 Week 4 Lab 4 Complexity of Computational Problems

Purchase here

http://devrycourse.com/ECET%20370?product_id=578

Product Description

General Instructions

Exercise 1 uses the programs in DocSharing labeled “Search algorithms."

Exercise 1: Review of the Lecture Content Create a project using the ArrayList class and the Main class provided in DocSharing. The ArrayList class contains implementations of the first three search methods explained in this week’s lecture: sequential, sorted, and binary search. The Main class uses these three methods. These programs test the code discussed in the lecture. Compile the project, run it, and review the code that is given carefully.

Exercise 2: Search Algorithms and Techniques Expand the project developed in the previous exercise to perform the following experiment: time the three search methods several times each and record the results. Compare the running times of the three search methods (sequential search, sorted search, and binary search) which are obtained during the experiment. What conclusions can be drawn?

Exercise 3: Searching Applications Select one of the following two problems to solve: Problem 1: Design and implement an algorithm that determines whether or not a given array of elements, list1, is completely contained within another given array of elements, list2. Consider two different scenarios: 1) both arrays are sorted; 2) both arrays are unsorted. Problem 2: Design an algorithm that when given a collection of integers in an unsorted array, determines the second smallest number (or second minimum). For example, if the array consists of the values 12, 23, 9, 17, 3, the algorithm should report the value 9, since it is the second smallest number in the array. Write a function that receives an array as a parameter and returns the second smallest number. To test your function, write a program that populates an...