Final Exam Flashcards

(31 cards)

1
Q

What is the definition of Big-Oh notation?

The order or an algorithm. Describes the upper bound of the algorithm.

The amount of memory needed to perform the algorithm

The Average case scenario.

Describes the best possible outcome.

A

The order or an algorithm. Describes the upper bound of the algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is meant by the term big Omega of an algorithm?

The worst-case scenario

The average case scenario

The mean time scenario

A formal way to express the lower bound of an algorithm’s running time.

A

A formal way to express the lower bound of an algorithm’s running time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

There are four general rules for calculating run times for for loops, nested loops, consecutive statements and if/else. Which one applies to Consecutive Statements?

Rule 1

Rule 3

Rule 4

Rule 2

A

Rule 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What , in general, is the order of a binary search algorithm?

A

O(nlog(n))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the big O or order of a bubble sort?

O(log(n))

O(n2)

O(Log(n2))

O(n2)

A

O(n2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does ADT stand for?

American Distinct Telegram

Abstract Data Type

Abstract Digital Template

Abnormal Digital Template

A

Abstract Data Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following statements is true about a list ADT?

At least a single linked list must be used.

It can be implemented using an Array.

The list must be dynamically allocated.

Neither a doubly or singly linked list can be used because an array is direct access.

A

It can be implemented using an Array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you insert into a single linked list?

There are no insertions once the list is initially created. To insert a record you have to create a new list.

Insertions are always done at the end of the list.

You must keep track of the record after and before of where it goes so you can change the links.

Insertions are always done at the beginning of the list

A

You must keep track of the record after and before of where it goes so you can change the links.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the relationship between a vector and a list?

Lists cannot be searched, vectors can.

Records in the List ADT can cheaply be inserted and deleted, The vector ADT can be indexed in constant time.

The list uses doubly linked lists, the vector uses arrays.

They are the same.

A

Records in the List ADT can cheaply be inserted and deleted, The vector ADT can be indexed in constant time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which ADT would be most commonly used to evaluate postfix notations?

Queue

Stack

Binary Tree

Dequeue

A

Stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the definition of a binary tree?

A tree in which no node may have more than two children.

A tree with only two nodes

A tree that must have either one or two nodes

A tree that can only go up and down

A

A tree in which no node may have more than two children.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

An arithmetic expression is usually expressed in human terms as what type of notation?

Inorder

Postorder

Aft Order

stern order

A

Inorder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The average depth of a binary search tree, based upon the number of nodes (N) is?

O(log(N))

O(N )

O(Nlog(N))

O(N2)

A

O(log(N))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does AVL stand for?

Adelson-Velskii and Landis Tree

Automated Directed Landis Tree

A latin term meaning balanced tree

Advanced-Data structure linear

A

Adelson-Velskii and Landis Tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a major characteristic of a B tree?

The data is stored in leaves.

All of the data is in the left child.

All of the data is in the right child.

The root is never a leaf.

A

The data is stored in leaves.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Each key of a record or group of data is mapped into some number that ranges from 0 to the Tablesize-1 and placed in the appropriate cell. The mapping is called a _______________________.

Table Function

Boolean Function

Mapping Function

Hash Function

A

Hash Function

17
Q

When two keys generate the same hash it is called a ___________________.

Merger

Meeting

Hashed

Collision

18
Q

A hash function should have certain desirable properties. What is one of them?

They should always use the MOD function.

They should not create randomly distributed values.

The function should create an even distribution of hash values.

They should never use more than the first three characters of the key

A

The function should create an even distribution of hash values.

19
Q

What did the book say about English?

English is not a second language

English is not random.

English is non-ambiguous.

Words in the English Language are good values for hash functions

A

English is not random.

20
Q

What is separate chaining

A

To keep a list of all elements that hash to the same value.

21
Q
A priority Queue is a data structure that allows at least the following operations: 
  add and remove both front and back
  insert and delete
  insert and deleteMin
  addback and removefront
A

insert and deleteMin

22
Q

What is a graph?

Any data structure
A graphical image
A graph G = (V,E) where V stands for vertices and E stands for Edges
ny vector

A

A graph G = (V,E) where V stands for vertices and E stands for Edges

23
Q

What statement best describes a path?

The distance from one not to another

A sequences of vertices w1, w2, w3 .. wn such that (wi, wi+1) is contained in E.

The method of accessing an individual node.

Any sequence of indexes that allow you to iterate through the list

A

A sequence of vertices w1, w2, w3 .. wn such that (wi, wi+1) is contained in E.

24
Q

A simple path is one where all vertices are________.

the same

distinct

obtuse

intrusive

25
An undirected graph is _______________ if there is a path from every vertex to every other vertex. linked specific random connected
connected
26
A graph the is connected from every vertex to every other vertex is also called___________________. weakly connected recursive cyclic strongly connected
strongly connected
27
What is a brief definition of a Topological Sort in a graph? Ordering of vertices in an undirected cyclic graph Ordering of vertices in a directed acyclic graph. Ordering of vertices in a directed cyclic graph Ordering of vertices
Ordering of vertices in a directed acyclic graph.
28
Ordering in a Topological Sort is not possible in a graph if the graph contains a __________________, non-unique paths. cycle edge duplicate set of vertices.
cycle
29
What is a greedy algorithm? Get the longest edge first Get the shortest edge first. Do the best thing at each stage. Find the shortest edges and use those without analysis
Do the best thing at each stage.
30
What is the difference between an unweighted shortest path algorithm and a weighted edged shortest path algorithm? There is no difference other than the length of time it takes to perform the search Unweighted is an infix notation search, Weighted works more or less like a spanning tree. Unweighted algorithms can have negative values on the edges. Unweighted is a breadth-first search, The weighted algorithm must take into account the weight of the edges.
Unweighted is a breadth-first search, The weighted algorithm must take into account the weight of the edges.
31
If a graph has negative edge costs, what can we say about Dijkstra's algorithm? It has no effect on it. The look-ahead function does not provide any meaningful data. It reduces efficiency by introducing contradictory variables. It does not work
It does not work