Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER ALL..not enough credit please Question 16 10 pts Two students are discussing an algorithm which divides its input in half repeatedly (something like

PLEASE ANSWER ALL..not enough credit please image text in transcribed
image text in transcribed
image text in transcribed
Question 16 10 pts Two students are discussing an algorithm which divides its input in half repeatedly (something like binary search but not actually binary search!) until reaching a basecase. One says that it is O(logn), while the other says it is O(n/2) Explain who is correct, and justify your answer. HTML Editore B Y V O A - A - I. E 3 1 1 N VSGV D 1 T x x 12pt 9 E - Paragraph Question 17 5 pts Short Answer: Stacks, Lists, Generics In which situation would it be better to use a linked list over an array. Why? Storing student objects to track a class roster over the duration of a semester. This is because deleting students that drop and inserting students that add the course is faster and worth slower access times, even though you will access students more often then you remove or add them. Storing a list (in alphabetical order) of all books owned at a library. Even though books are very rarely removed from the library's collection, since the books are stored in order it will be faster to traverse then to access the books in an array. None of these is correct. Storing all the directions (in order for a route on a digital map. This is because removing and adding directions, should the route change, is faster and slower access times don't matter because the directions are accessed in order Question 18 5 pts Question 18 5 pts Which of the following is not a reason to implement a Stack with a Linked List (instead of an Array)? O All of the above are reasons to implement a Stack with a Linked List instead of an Array Some stack operations are slower if the stack is implemented with an Array instead of with a Linked List. O A Stack would waste more memory if it was implemented with an Array than with a Linked List. The structure of a Linked List is more similar to a Stack (for example a frontrtopthat can be manipulated), so it makes more sense to implement a stack with a Linked List. Question 19 8 pt mplement a recursive method called select th that takes the first node in a singly linked list and eturns the element at position k (starting at zero). For example, if selectKth(2) is called on a list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions

Question

Question What happens to my plan if I die?

Answered: 1 week ago