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
What is an example of new technology having a positive impact on sustainability?
kolezko [41]

Answer:

The main technology that brings positive news on sustainability in any company would be the use of renewable technology more because we can use energy. For example, by using equipment such as solar panels, windmills or water turbines, we can generate electricity and use it many times.

3 0
1 year ago
when doing a complex presentation which of the fallowing will be the best tool to begin designing your presentation
qaws [65]

but where are the option bro

7 0
2 years ago
Read 2 more answers
Najbardziej znane przeglądarki internetowe
grin007 [14]

What is the question?????


4 0
4 years ago
Read 2 more answers
Carlos works in the IT department at Sample Bank. He uses a cloud-based e-mail system and has been asked by his manager to estab
vodomira [7]

Answer:

Option (A) i.e., Chargeback is the correct answer to the following question.

Explanation:

In the cloud-computing, Chargebacks is used for the metrics on the e-mail box which is used by the departments or the organizations, by this system, department budgets has been billed for the costs of entertain the department e-mails. It is applied on the expenses of the IT sectors or services for the strategies of the accounting.

Option B is incorrect because billback it is an application that are used in organization for needs to determining the resources of IT.

Option C is incorrect because Showback is the policy that is used by the IT for rise the expenses.

7 0
3 years ago
Which social network made the mistake of alienating its early adopters by deleting suspicious accounts?​?
mamaluj [8]
<span>Which social network made the mistake of alienating its early adopters by deleting suspicious accounts?
Ryze
Friendster
SixDegrees
Tribe.net
MySpace


The Correct answer is </span>Friendster.
5 0
4 years ago
Other questions:
  • If you're able to understand directions more easily when you hear them instead of reading them you are most likely
    12·1 answer
  • In what year was google launched on the web?
    14·1 answer
  • An administrative assistant types a document, saves, and prints. The assistant is using _____.
    13·1 answer
  • What does route print do?
    15·1 answer
  • What are the 6 major forms that Energy can be grouped into?
    10·1 answer
  • Which of the following is part of a person's digital footprint? *
    5·1 answer
  • Jared has trouble remembering when his assignments are due, and he wants to keep reminders on his computer. Which online note-ta
    10·2 answers
  • Match each method of communication with its intended purpose.
    14·1 answer
  • Answer for 3 and 4 please
    15·2 answers
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!