Question

Please answer these questions for me. I have two sort algorithms. One has a Big O...

Please answer these questions for me.

I have two sort algorithms. One has a Big O of O(n) and the second one has a O(log2n)

a) What is the difference/results of each algorithm when sorting 20 pieces of data

b) What is the difference/results of each algorithm when sorting 2,000,000 pieces of data

c) Explain the above

0 0
Add a comment Improve this question Transcribed image text
Answer #1

simply replace the number of input in the time given

e.g. for O(n) for 20 inputs 20 unit time approximately will be taken.

on the other hand for O(log2n) log40 units time will be taken.so the order simply gives an approximation of what the rate of change will be with inputs.

it is obvious that for larger inputs you get a precise approximation.

Add a comment
Know the answer?
Add Answer to:
Please answer these questions for me. I have two sort algorithms. One has a Big O...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please I need it urgent thanks algorithms 2.1 Searching and Sorting- 5 points each 3. What is the worst case for quick sort? What is the worst case time com- plexity for quick sort and why? Ex...

    please I need it urgent thanks algorithms 2.1 Searching and Sorting- 5 points each 3. What is the worst case for quick sort? What is the worst case time com- plexity for quick sort and why? Explain what modifications we can make to quick sort to make it run faster, and why this helps. 4. Give pseudocode for an algorithm that will solve the following problem. Given an array AlL..n) that contains every number between 1 and n +1 in...

  • In C++ How do you demo that selection sort has O(N2) complexity? Meaning of the O(N2)....

    In C++ How do you demo that selection sort has O(N2) complexity? Meaning of the O(N2). If you have N=1000 input values the selection sort need roughly 1000000 steps. What is the meaning of thee ‘step’ here? One ALU comparison, one swapping of values, or one calculation step on one value of the array. What is the total number of steps for selection sort? Let me use an example N=5, to help me think 4+1-__ 3+1-__ 2+1-__ 1+1-__ F(N)=__________________________ This...

  • ?PLEASE READ CAREFULLY QUESTION #1 I’m doing a project which requires you to implement 4 sorting...

    ?PLEASE READ CAREFULLY QUESTION #1 I’m doing a project which requires you to implement 4 sorting algorithms. Bubble sort pair-wise, Bubble sort list-wise a.k.a selection sort, merge sort, and quick sort. These 4 sorting methods takes in an array of strings and sorts them alphabetically from a-z. I have all 4 sorting algorithms working fine, but I still need to fill out the table. There’s only one section I need help filling out. I basically need help filling out the...

  • Please DONOT attempt this Big O question if you don't know the exact answer. Algorithms question...

    Please DONOT attempt this Big O question if you don't know the exact answer. Algorithms question (Big O): Please explain me in details the order of growth (as a function of N) of the running times of each of the following code fragments: a)         int sum = 0; for (int n = N; n > 0; n /= 2)    for(int i = 0; i < n; i++)      sum++; b)         int sum = 0; for (int i =...

  • please check my answers if it wrong answer me a) (25 points) Suppose that you are...

    please check my answers if it wrong answer me a) (25 points) Suppose that you are asked to analyze the performance. Algorithms operate on 1D array of size nor 2D a of the algorithms below, write down the Big O or order of grow terms of n. If the algorithm cannot be applied to the array, write 0(1), O(log n), O(n), O(n logn), 90), O(n"), O(n!). The will only be given for reasonable Big O answers. & algorithms for their...

  • Inal Examination 17. Which of the sorting algorithms listed below has the time fastest best case...

    Inal Examination 17. Which of the sorting algorithms listed below has the time fastest best case run (a) Heap sort (b) Merge sort (c) Quick sort (d) Insertion sort 18. Which statement below is false: (a) Quick uick sort and merge sort are divide and conquer algorithte (b) Counting sort is a linear time sorting algorithm. (e) Insertion sort and quicksort have similar best case (d) Generic minimum spanning tree algorithm is 19. Counting sort and radix sort are linked...

  • Please help me to solve the problem with java language! An implementation of the Merge Sort...

    Please help me to solve the problem with java language! An implementation of the Merge Sort algorithm. Modify the algorithm so that it splits the list into 3 sublists (instead of two). Each sublist should contain about n/3 items. The algorithm should sort each sublist recursively and merge the three sorted sublists. The traditional merge sort algorithm has an average and worst-case performance of O(n log2 n). What is the performance of the 3-way Merge Sort algorithm? Merge Sort algorithm...

  • [Code in C] Help me with this. Not sure what to do. 1 Couting Sort You...

    [Code in C] Help me with this. Not sure what to do. 1 Couting Sort You may have learned some sorting algorithms - such as bubble sort ad quicksort in CS 110 and CS 210. This homework is about counting sort. Let n be the number of elements to be sorted. Bubble sort and quicksort assume tha time, which one is larger and which one is smaller. They make no assumption on the values of the elements t we can...

  • Please type, no handwriting!!! In case i cant see clear... 4. (5 Points) Describe best case,...

    Please type, no handwriting!!! In case i cant see clear... 4. (5 Points) Describe best case, average case, and worst case in terms of Big O Notation. When implementing algorithms or data structures which two “Big O cases” are most important to consider and why? 5. (10 points) Bubble Sort and Selection Sort explain the similarities and difference between the two algorithms. What is the Worst Case Big (O) and why?

  • The objective of this Assignment is to compare the performance of some standard SORT algorithms. You...

    The objective of this Assignment is to compare the performance of some standard SORT algorithms. You should look at MergeSort, QuickSort, and Insertion Sort; you can also look at an additional Sort mechanism that isn't covered in class or that isn't covered in the book for extra credit. You will have to find the right implementations in Java so that you can make your comparisons. Things you will be comparing are the raw running time and the time complexity in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT