Question

Please give little explanation, I'm trying to understand why. 2. List appropriate Worst Case Big O...

Please give little explanation, I'm trying to understand why.

2. List appropriate Worst Case Big O Notation under the different algorithms or data structure operations.

O(1)

O(n)

O(n ^ 2)

O(log n)

A. Directly Accessing value in a 2-dimensional by [row][column]

B. Selection Sort then Binary Search on a 1,000,000 element array

C. Binary Search

D. Highest element algorithm for 10,000 element array.

E. Traversal of 6 character string

O(n)

3. Give examples of Implicit declarations for Python and C++. Give examples of explicit declarations for Python and C++.

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

`Hey,

Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

1)

Directly Accessing value in a 2-dimensional by [row][column] is O(1) since accessing is 1 operation

2)

Selection Sort then Binary Search on a 1,000,000 element array is O(n^2) since selection sort takes O(n^2)

3)

Binary Search is O(log(n))

4)

Highest element algorithm for 10,000 element array is O(n) since it uses 1 loop

5)Traversal of 6 character string O(n)

Note: Brother According to Chegg's policy we are only allowed to answer first Q if there are many. So, I request you to post other part as separate posts

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Please give little explanation, I'm trying to understand why. 2. List appropriate Worst Case 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...

  • 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...

  • 1.If a list is implemented as a singly linked stack, give the big-O worst-case time complexity...

    1.If a list is implemented as a singly linked stack, give the big-O worst-case time complexity of the following operations (as usual use the smallest standard big-O category that works: a) push_front, b) push_back, c) lookup, d) read the i'th member 2.Repeat question 3 for a dynamic array (for example, as in the C++ vector class)

  • 1. State and explain the definition of big-O. 2. Explain why we use big-O to compare...

    1. State and explain the definition of big-O. 2. Explain why we use big-O to compare algorithms. 3. Explain why binary search runs in O(log n) time. 4. Under what conditions is it possible to sort a list in less than O(nlog n) time? 5. List and explain the worst-case and average-case running times for each Vector method below: (a) insert(iterator here, Object item) (b) insertAtHead (c) insertAtTail (aka push back) (d) get(iterator here) (e) get(index i) (f) remove(iterator here)...

  • NEED ASAP PLEASE WILL GIVE GOOD RATE RIGHT AWAY FOR ALL ANSWERS! MULTIPLE CHOICE no explanation...

    NEED ASAP PLEASE WILL GIVE GOOD RATE RIGHT AWAY FOR ALL ANSWERS! MULTIPLE CHOICE no explanation needed SPRING Cs 424-524 aUESTION 1 12 points each, 30 points total +2 extra) Multiple 1. The main reason to include enumeration types in a programming language is to TEST2 choice: circle or check the best answer a. Make programs run faster b. Improve program readability c. Eliminate unnecessary /O d. Reduce type errors 2. A C++ value parameter is an example of a....

  • **JAVA PLEASE!!** CSE205 Assignment 2 ASCII Terrain Generator 5Opts Topics: Arrays Multidimensional Arrays Metho...

    **JAVA PLEASE!!** CSE205 Assignment 2 ASCII Terrain Generator 5Opts Topics: Arrays Multidimensional Arrays Methods Loops and Conditionals Description The goal of this assignment is for you to produce a simple procedurally generated terrain map out of ASCII character symbols. This will be done through simple probability distributions and arrays Use the following Guideline s: Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc) Keep identifiers to a reasonably short length. User upper case for constants....

  • For a C program hangman game: Create the function int play_game [play_game ( Game *g )]...

    For a C program hangman game: Create the function int play_game [play_game ( Game *g )] for a C program hangman game. (The existing code for other functions and the program is below, along with what the function needs to do) (Also the link to program files (hangman.h and library file) is below the existing code section. You can use that to check if the code works) What int play_game needs to do mostly involves calling other functions you've already...

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