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
miss Akunina [59]
2 years ago
12

assume that you want to sort an array have 100000 elements which algorithm (insert sort algorithm or quick sort algorithm) is th

e best option ? why?
Computers and Technology
1 answer:
Rama09 [41]2 years ago
4 0

Answer:

Quick Sort.

Explanation:

Quick Sort will be best suited for an array having 100000 elements instead of the insertion sort algorithm because as we know the average time complexity of quick sort is O(NlogN) and for insertion sort is O(n^2).The sorting totally depends upon the pivot that is being selected in quick sort.

While insertion sort is best suited for arrays that are already sorted it takes O(n) time in those cases.

Since the array that we have is very large and so we need an algorithm that can sort the array faster than the other sorting algorithms.Quick  Sort is also inplace and does not requires extra space to do the sorting.

You might be interested in
What are the two access modes that are used when opening a file for input and output when pickling?
san4es73 [151]

The two access modes that are used when opening a file for input and output when pickling are rb and wb.

<h3>What is pickling?</h3>

Pickle is generally used in Python to serialize and deserialize a Python object structure. In other words, it is the act of transforming a Python object into a byte stream in order to save it to a file/database, maintain program state across sessions, or transport data over a network. By unpickling the pickled byte stream, the original object hierarchy can be recreated. This entire procedure is comparable to object serialization in Java or .Net.

When a byte stream is unpickled, the pickle module first makes an instance of the original object before populating it with the right data. To accomplish this, the byte stream only carries data relevant to the original object instance.

To learn more about python visit:

brainly.com/question/13437928

#SPJ4

8 0
1 year ago
Which two approaches optimize test maintenance and support future declarative configuration changes? Choose 2 answers Create a m
patriot [66]

Answer:

B and C

Explanation:

B. Create a method that load valid account records from a static resource, then call this method within test method

C. Create a method that creates valid records, then call this method within test methods

3 0
2 years ago
What are some ways to accomplish full-duplex (FDX) digital communications on guided medium at the physical layer (OSI Layer 1)?
labwork [276]

Answer:

d. All of the above

Explanation:

Physical layer is the lowest layer of the OSI reference model that deals with the setup of physical connection to the network and with transmission and reception of signals.

Full duplex (FDx) is a bidirectional type of communication system where two end nodes send and receive data signals at the same time, and a single carrier is simultaneously used for dual communication.

To send or receive data, the participating nodes in a Full Duplex system do not have to wait for a free carrier/medium. It employs a medium that has at least two internal channels - one for sending and one for receiving.

Based on the above explanations, options A, B and C are valid and are correct ways to accomplish full-duplex (FDX) digital communications on guided medium at the physical layer (OSI Layer 1). There all of them are correct.

6 0
2 years ago
We have said that the average number of comparisons need to find a target value in an n-element list using sequential search is
bija089 [108]

Answer:

Part a: If the list contains n elements (where n is odd) the middle term is at index (n-1)/2 and the number of comparisons are (n+1)/2.

Part b: If the list contains n elements (where n is even) the middle terms are  at index (n-2)/2 & n/2 and the number of comparisons are (n+2)/2.

Part c: The average number of comparisons for a list bearing n elements is 2n+3/4 comparisons.

Explanation:

Suppose the list is such that the starting index is 0.

Part a

If list has 15 elements, the middle item would be given at 7th index i.e.

there are 7 indices(0,1,2,3,4,5,6) below it and 7 indices(8,9,10,11,12,13,14) above it. It will have to run 8 comparisons  to find the middle term.

If list has 17 elements, the middle item would be given at 8th index i.e.

there are 8 indices(0,1,2,3,4,5,6,7) below it and 8 indices(9,10,11,12,13,14,15,16) above it.It will have to run 9 comparisons  to find the middle term.

If list has 21 elements, the middle item would be given at 10th index i.e.

there are 10 indices (0,1,2,3,4,5,6,7,8,9) below it and 10 indices (11,12,13,14,15,16,17,18,19,20) above it.It will have to run 11 comparisons  to find the middle term.

Now this indicates that if the list contains n elements (where n is odd) the middle term is at index (n-1)/2 and the number of comparisons are (n+1)/2.

Part b

If list has 16 elements, there are two middle terms as  one at would be at 7th index and the one at 8th index .There are 7 indices(0,1,2,3,4,5,6) below it and 7 indices(9,10,11,12,13,14,15) above it. It will have to run 9 comparisons  to find the middle terms.

If list has 18 elements, there are two middle terms as  one at would be at 8th index and the one at 9th index .There are 8 indices(0,1,2,3,4,5,6,7) below it and 8 indices(10,11,12,13,14,15,16,17) above it. It will have to run 10 comparisons  to find the middle terms.

If list has 20 elements, there are two middle terms as  one at would be at 9th index and the one at 10th index .There are 9 indices(0,1,2,3,4,5,6,7,8) below it and 9 indices(11,12,13,14,15,16,17,18,19) above it. It will have to run 11 comparisons  to find the middle terms.

Now this indicates that if the list contains n elements (where n is even) the middle terms are  at index (n-2)/2 & n/2 and the number of comparisons are (n+2)/2.

Part c

So the average number of comparisons is given as

((n+1)/2+(n+2)/2)/2=(2n+3)/4

So the average number of comparisons for a list bearing n elements is 2n+3/4 comparisons.

6 0
3 years ago
Internet Explorer, Apple Safari, Google Chrome, and Mozilla Firefox are examples of web browsers.
Brrunno [24]
True, and there are many other web browsers
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which command on the Insert tab of the PowerPoint Online application is used to add a Venn diagram or process chart to a present
    12·2 answers
  • You want to discard your old computer and want to securely erase the data from your hard drive. What can you use to do this and
    6·1 answer
  • The basic work area of the computer is it screen that you when you first fire up your computer
    6·1 answer
  • Que son los sistemas de control con retroalimentacion
    10·1 answer
  • What is the base for a hexadecimal number system?
    11·1 answer
  • In the world of computing,accessibility MOST often refers to what
    12·1 answer
  • What are some other features of sending attachments in Outlook 2016? Check all that apply.
    9·2 answers
  • 8.
    9·1 answer
  • What are you win your good at tech
    7·2 answers
  • What type of an attack is being executed if an attacker substituted an invalid mac address for the network gateway so no users c
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!