Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED ANSWERS IN NEXT 5 MINUTES PLEASE!! PLEASE ANSWER ASAP!! NEED ONLY ANSWER OF LETTER CHOICES. NO EXPLANATIONS NEEDED PLEASE HELP!! 1) Which data structure

NEED ANSWERS IN NEXT 5 MINUTES PLEASE!! PLEASE ANSWER ASAP!! NEED ONLY ANSWER OF LETTER CHOICES. NO EXPLANATIONS NEEDED PLEASE HELP!!

1) Which data structure provides the best big O time complexity for the operation of finding the minimum value?

a.

a linked list

b.

a binary search tree

c.

a heap

d.

a vector

2) What is the Big O time complexity of checking if any of the top 10 elements of a stack of strings are the empty string?

a.

O(n)

b.

O(log n)

c.

O(n2)

d.

O(1)

3)

What is the Big O time complexity of checking if a list of numbers is sorted in descending order?

a.

O(1)

b.

O(n)

c.

O(n2)

d.

O(log n)

4)

What would be wrong with modifying the UnsortedType class as follows?

private: ItemType * info; // CHANGE: make the array a pointer int length; // rest of fields are unchanged from the current version of the code public: UnsortedType(ItemType *vals, int lgth) { // CHANGE: pass in array info = vals; length = lgth; } // leave rest alone 
a.

The constructor should allocate a new array and copy the elements of the parameter into this new array

b.

info should still be an array instead of a pointer

c.

the array parameter to the constructor might have fewer than 5 elements

d.

The new version of UnsortedType is fine

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_2

Step: 3

blur-text-image_3

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

If then x = x - 4x + 4 9-x+ x 6x - 12 ,2 6 + x9 +

Answered: 1 week ago