DS&AD Final Exam

¡Supera tus tareas y exámenes ahora con Quizwiz!

True or False: Time complexity of binary search algorithm is consistent.

False

An algorithm is a _______ set of precise instructions for performing computation.

Finite

For a recursive algorithm

a base case is necessary and is solved without recursion

An algorithm is

a procedure for solving a problem

An algorithm can be represented through

all the mentioned

A complexity of algorithm depends upon

both time and space

The Worst case occur in linear search algorithm when

item is the last element in the array or is not there at all

The worst-case occurs in linear search algorithm when

item is the last element in the array or is not there at all

Optimization of algorithm means

making that algorithm fast by time and compact by space

The big-theta notation for f(n) = nlog(n^2 + 1) + n^2logn is

n^2logn

The big-theta notation for function f(n) = 2n^3 + n - 1 is

n^3

The time complexity of linear search is given by

none of the mentioned

Which algorithm is better for sorting between bubble sort and quick sort?

quick sort

To sort a list with n elements, the insertion sort begins with the _____ element.

second

The operation of processing each element in the list is known as

traversal

The big-omega notation for f(x,y) = x^5y^3 + x^4y^4 + x^3y^5 is

x^3y^3

There are two algorithms suppose A takes 1.41 milliseconds while B take 0.9 milliseconds, which one of them is better considering all other things same.

B is better than A

Out of the following which property algorithms does not share?

Constancy

Which of the following case does not exist in complexity theory?

Null case

The complexity of Binary search algorithm is

O(log n)

The complexity of linear search is

O(n)

The complexity of Bubble sort algorithm is

O(n^2)

The complexity of bubble sort algorithm is

O(n^2)

The worst-case complexity for insertion sort is

O(n^2)

The worst-case complexity of quick sort is

O(n^2)

The big-O notation for f(n) = (nlogn + n^2)(n^3 + 2) is

O(n^5)

The complexity of merge sort algorithm is

O(nlogn)

If f(x) = (x^3 - 1)/(3x + 1), then what is f(x)?

O(x^2)

If f(x)=2x^2 +x^3(logx), then what is f(x)?

O(x^2)

In _____ search each element is compared with x till not found.

Sequential

For an algorithm which is most important characteristics that makes it acceptable

correctness and precision

An algorithm in which we divide the problem into subproblems and then we combine the sub solutions to form a solution to the original problem is known as

divide and conquer

An algorithm which uses the past results and uses them to find the new results is

dynamic programming algorithms


Conjuntos de estudio relacionados

Primerica Life Insurance Exam Chapter 5

View Set

A-Level Geography: Glaciation Keywords

View Set

Unit 5: Big Data AP Practice Questions

View Set

PSYC 317 Crisis Intervention Ch. 3-4

View Set

California Real Estate Salesperson Course

View Set

Fundamentals of Nursing - Chapter 8: Communication (Taylor Foundations 9th Edition)

View Set