1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
melomori [17]
3 years ago
10

Suppose that you sort a large array of integers by using a merge sort. Next you use a binary search to determine whether a given

integer occurs in the array. Finally, you display all of the integers in the sorted array. a. Which algorithm is faster, in general: the merge sort or the binary search? Explain in terms of Big O notation. b. Which algorithm is faster, in general: the binary search or displaying the integers? Explain in terms of Big O notation.
Computers and Technology
1 answer:
klio [65]3 years ago
6 0

Answer:

See explaination

Explanation:

Merge sort working-

1.type of recursive sorting algorithm.

2.divides given array into halves.

3. Sort each halves. Merge this halves to give a sorted array.

4. Recursive call continues till array is divided and each piece has only one element.

5. Merge this small pieces to get a sorted array.

Binary search-

1. It is a search algorithm.

2. Requires a sorted array to work on.

3.Works repetively dividing a half portion of list that could contain item until it has narrowed down the possible location to just one.

Comparing Merge sort and Binary Search using Big O notation-

Merge Sort - O(n*log(n)) in all scenario whether best, average or worst case.

Binary Search- O(log(n)) in average and worst case. O(1) in best case.

So seeing the above comparison Binary search is faster.

Comparing Binary search and displaying the integers-

Binary Search- O(log(n)) in average and worst case. O(1) in best case.

Displaying the integer-O(1) if already initialized, O(n) in case of loop or function.

So seeing above one can conclude that binary search is fast. But in best case both works in a similar manner.

You might be interested in
WILL THUMBS UP!!!!!ALL COMMENTS!!!!!!
Mariulka [41]
True

the Articles of Confederation are finally ratified. The Articles were signed by Congress and sent to the individual states for ratification on November 15, 1777, after 16 months of debate. Bickering over land claims between Virginia and Maryland delayed final ratification for almost four more years. Maryland finally approved the Articles on March 1, 1781, affirming the Articles as the outline of the official government of the United States. The nation was guided by the Articles of Confederation until the implementation of the current U.S. Constitution in 1789.
4 0
3 years ago
in a typical e-mail address, the "host" is A. an account designated by a user name B. CPU processor 2500 C. the receiver of an e
NISA [10]
The correct answer is A! :)
5 0
3 years ago
Read 2 more answers
What would be the consequences if the Memory Manager and the
Ann [662]

Answer:

Result could be a memory leak or a spaceleak.

Explanation:

The result if a memory supervisor and a processor administrator quit conveying would prompt a negative result as they have to impart all together for the procedure manager to process the data that is being conveyed in and out.

3 0
3 years ago
Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
Romashka-Z-Leto [24]

I'm not 100% sure but I think it might be Microsoft excel.... correct me if I'm wrong

7 0
3 years ago
Read 2 more answers
Which type of classroom enables students to attend lectures without being physically present with the teacher?
Kisachek [45]
An online class? I think lol
5 0
4 years ago
Other questions:
  • Lindsay owns a candy store that typically makes all if its sales to tourists visiting a nearby zoo. Why might she decide to set
    14·2 answers
  • Rachelle is an office manager for an active real estate agency. She’s overseeing a transition to a more complete reliance on ele
    9·1 answer
  • A binary message consisting of four bits was sent to you by a friend. The message was supposed to be ABAB. Unfortunately, your f
    8·1 answer
  • _____ is the measure of a system’s ability to expand, change, or downsize easily to meet the changing needs of a business enterp
    11·1 answer
  • Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu
    15·1 answer
  • Which of the following is NOT an example of application software?
    8·1 answer
  • In a well-developed paragraph - using domain-specific vocabulary and academic writing - address the following writing prompt:
    12·1 answer
  • 5. In which of the following stages of the data mining process is data transformed to
    9·1 answer
  • Consider the following method, which is intended to count the number of times the letter "A" appears in the string str.
    13·1 answer
  • 1. (01.03 MC) What is a string in Python
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!