Discrete Math help
Algorithm Analysis
- Consider searching algorithms on the following array of data:
[22 21 9 4 16 2 10 14 20 31 26 19 17 28 8 13]
Suppose you want to implement a searching algorithm to see if the data set contains the number 19. Demonstrate how the search would go if you used:
- A sequential search
- A binary search
- Suppose an algorithm that processes a data set of size 8 has a runtime of 72. The same algorithm has a runtime of 110 when applied to a data set of size 10; and when applied to a data set of size 20, it has a runtime of 420. Using big-O notation, state the runtime for this algorithm for the general case of a data set of size n.
- Suppose you develop an algorithm that processes the first element of an array (length of n), then processes the first 2 elements, then the first 3 elements, and so on, until the last iteration of a loop, when it processes all elements. Thus, if n = 4, the runtime would be 1 + 2 + 3 + 4 = 10.
- Create a table that depicts the runtime for arrays of length 1 to 10. Would you expect the general runtime to be O(n), O(n2), O(n3), or some other function of n? Explain.
12 years ago
20
Answer(2)![blurred-text]()
![]()
![blurred-text]()
![]()
Purchase the answer to view it

NOT RATED
- computer_science_work_1.odt
Purchase the answer to view it

NOT RATED
- algorithm_analysis_solution.docx
Bids(1)
other Questions(10)
- need research - 3 firms that cut advertising budget and then experienced a drop in sales as a result
- Advertising and Marketing
- Transformational Leadership 2.1
- Expert Answers
- I need 3 original reading/literacy lesson plans developed for a 4th grade class. Plagiarism free!!!!!
- Practice Online Research
- LAW/531 LAW531 Week4 Learning Team Reflection
- HRM/531 Week 6 Career Development Plan Summary
- BUS520 WEEK 3-4
- Financial Statement Analysis
