313 Final

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

In an array implementation of binary heap, what is the formula to calculate the index of the parent of the element with index i?

(i - 1) / 2

The in-order traversal of a tree will yield a sorted listing of elements of the tree in:

A binary search tree.

A binary tree in which all of its levels except possibly the bottom-most, have the maximum number of nodes...and all the nodes at the bottom-most level appear as far left as possible is known as:

A complete binary tree.

A binary tree whose every node has either zero or two children is called a:

A full binary tree.

Which of the following is a two way list?

A list traversed in two directions.

Which statement is correct?

An AVL tree is a balanced binary search tree.

Which of the following is a reason to use an array instead of an ArrayList?

An ArrayList can allocate more space that it needs.

Stack can be implemented using either:

An array or a linked list.

Which of the following data structures is a linear data structure?

Arrays

The in-order traversal of a tree will yield a sorted listing of elements in

Binary search trees.

Which is true of merge sort and quick sort?

Both have same average case complexity.

A data structure where elements are added or removed at either end but not in the middle is a:

Deque

Other name for a directed graph is:

Digraph

What is the name of the instructor for this course?

Dr.Svitak

The complexity of a linear search algorithm is:

O(n)

The runtime complexity of the merge sort algorithm is:

O(n*log(n))

The runtime complexity of the quicksort algorithm is:

O(n*log(n))

The runtime complexity of the insertion algorithm is:

O(n^2)

Adding an element to a stack means:

Placing the element at the top.

One difference between a queue and a stack is:

Queues use two ends of the structure; stacks use only one.

Which indicates pre-order traversal in a binary tree?

Root, Left sub-tree, Right sub-tree.

Well-formed parenthesis can be-checked using which following data structure?

Stack

The terms push and pop are related to which data structure?

Stack.

If there is a path from each vertex to every other vertex in a directed graph then the directed graph is:

Strongly Connected

Which of the following is a reason to use an ArrayList instead of an array?

You can store objects in an ArrayList, but not in an array.

What is the formula to compute back, the index of the element in the array data where the next new item is inserted into the queue?

back = ((front + theSize) % data.length)

In a min-heap the smallest key is in:

the root.

Heap sort is found to be very efficient:

with regard to the storage requirement.

Linked list are best suited:

Where the size of the structure and the data in the structure is constantly changing.

What of the following cases does not exist in runtime complexity theory?

Null case.

Each node in a singly linked list has _ fields.

2

In an array implementation of a binary heap, what is the formula to calculate the index of the left child of the element with index i?

2 * i + 1

If you began with an empty AVL tree, and then inserted the following integers in the tree in the following order: 20,40,15,25,30,80,75,95,35,90 Which integer would be at the root after inserting all the integers?

30

Here is an array which has just been partitioned by the first step of quicksort: 3, 0, 2, 4 , 5, 8, 7, 6, 9

4 & 5.

The time factor when determining the efficiency of algorithm is measured by:

Counting the number of primitive operations.

The concept of order Big O is important because

It can be used to decide the best algorithm that solves a given problem & it determines the maximum size of a problem that can be solved in a given amount of time.

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

Iterating

Which term refers to a stack?

LIFO

Which of the following data structures is not a linear data structure?

None of the above. (The options were arrays & linked lists)

Two main measures for the efficiency of an algorithm are:

Time and space.

In a binary heap, where the root is removed then the rightmost element at the bottom-most level of the heap is replaced by the root. Why?

To make sure that it is still a complete binary tree.


Ensembles d'études connexes

NTDT200 exam 1 clicker/practice questions

View Set

Biz Org Chapter 9: Corporate Governance

View Set

Tax Prep Study (Part 2: Deductions)

View Set

Chapter 4 Mental Disorders and Suicide

View Set