Pre Assessment Flashcards

1
Q

Which term refers to a template for creating an object?

A

Class

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

Which characteristic of an algorithm is independent in nature?

A

Use an agnostic code repository

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

What is referred to as a data structure that stores subitems?

A

Record

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

Which factor takes the ability to easily update an algorithm into consideration?

A

Maintainability

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

What is a component of an algorithm that specifies a stopping point?

A

Finiteness

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

Which term refers to a type of search algorithm?

A

Linear

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

What is a high-level consideration in an algorithm’s design?

A

Simplicity

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

What is the primary method used to search for an item in a sorted way?

A

Binary search

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

Which review of an algorithm happens after implementation?

A

A posteriori analysis

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

Which factor helps measure the reusability of an algorithm?

A

Extensibility

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

Which search algorithm utilizes the divide-and-conquer strategy?

A

Binary search

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

Which algorithm requires data sorting as its first step?

A

Binary

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

What does a time complexity analysis of an algorithm include?

A

Worst case

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

Which data type do heap sorts work with?

A

Tree-based data structure

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

Which function is used in conjunction with a merge sort algorithm?

A

Recursive

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

Which attribute of a recursive function makes it unique?

A

Calls itself

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

What is x in the following block of logic?
X=28

If x > 10 and x < 20
X=20
Elif x <= 30
X = 25
Elif x >= 50
X = 100
Else
X = 500

A

25

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

What is an if statement inside of an if statement referred to as?

A

Nested

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

Which search algorithm functions by continually dividing the data set in half until the sought item is found or the data set is exhausted?

A

Binary search

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

Which search algorithm has the best performance when the data set is sorted?

A

Interval search

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

Which format is used to store data in a hash table?

A

Array

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

Which term refers to a data structure that groups related items of data together?

A

Record

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

Which data structure is used to store unordered items by mapping each item to a location in an array?

A

Hash table

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

What is the advantage that a linked list has over an array?

A

Grows and shrinks as needed

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

What would be the best data structure for a hash table with simple chaining?

A

A doubly linked list

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

What is a leaf node on a tree?

A

Any node that does not have children nodes

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

What is a root node on a tree?

A

The starting node with no parents

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

What is the height of a tree?

A

The amount of ‘generations’ there are. The node starts at a height of 0, and count 1 for each generation after.

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

Which data structure is most dynamic in sorting data items of varying lengths?

30
Q

What is the resulting stack when the push(1) function is implemented on this stack yield?
8, 9, 3, 5 (top is 8)

A

1, 8, 9, 3, 5

31
Q

What will the peek() operation from this stack return?
8, 9, 3, 5 (top is 8)

32
Q

What is the set that results from set1 intersection set2, given these sets?
Set1 = {69, 82, 47}
Set2 = {11, 82}

33
Q

How many vertices does a graph have?

A

Vertices are the number of ‘nodes’ in a graph. Count them

34
Q

What nodes are considered adjacent ?

A

Any nodes that connect directly to the node are considered adjacent

35
Q

Which term describes a way of organizing, storing, and performing operations on data?

A

Data structure

36
Q

Which data structure is used to implement a dictionary data type?

A

Hash table

37
Q

Which element refers to the numeric positions in a list abstract data type (ADT)?

38
Q

Which characteristic of a class allows it to be used as an abstract data type (ADT)?

A

It consists of variables and methods

39
Q

What is the result when 6 is enqueued to the queue 7, 9, 8 (with 7 as the front)?

A

7, 9, 8, 6

40
Q

Which value would be returned form executing the sequence operation on the queue 7, 9, 8 (with 7 as the front)?

41
Q

Which queue results from executing the following queue operations on the queue 7, 9, 8 (with 7 as the front)?

Dequeue ()
Enqueue (6)
Enqueue (5)
Dequeue ()

42
Q

What will be the new state of the queue 7, 9, 8 (with 7 as the front) after the enqueue(3) operation?

A

7, 9, 8, 3

43
Q

What is the order of these functions by growth rate?
2/N, 37, 2^N, N log(N^2), N^2

A

2/N < 37 < N log(N^2) < N^2 < 2^N

44
Q

How many elements will be compared to linear search for 27 in this list?
[9, 3, 7, 2, 8, 15, 13, 35 95, 7, 4]

45
Q

What is the first element visited in this list when binary searching for the number 7?
[6, 7, 8, 9, 11, 15, 20]

46
Q

How many elements in a list of size 64 would be visited when using a binary searching for a number that is larger than all the values in the list?

47
Q

How may elements in a list of size 64 would be visited when using a binary searching for a number that is smaller than ally the values in the list?

48
Q

What is the runtime complexity of the algorithm O(N^N + 1)?

A

Exponential

49
Q

What is the runtime complexity for the expression 305 + (325*N)?

50
Q

What is the runtime complexity for this code?
For x in range(N):
For y in range(N):
For z in range(N):
Tot = tot + z
Print tot

51
Q

Which term describes an abstract data type (ADT) that python uses?

52
Q

Which abstract data type (ADT) is characterized by the LIFO (last in, first out) principle?

53
Q

Which queue operation removes an item from the front of the queue?

54
Q

Which function in python returns the number of times the desired value is found in a tuple?

55
Q

Which function in python is used to find a specific value in a tuple?

56
Q

Which python list function will remove all items from a list?

57
Q

Which abstract data type (ADT) allows operations at one end only?

58
Q

Which python list function removes the first instance of the specified element?

59
Q

How does the insertion sort algorithm sort through a list?

A

By iterating through the sorted list while placing each value into its correct sorted position within the list

60
Q

What is the average runtime complexity of the merge sort algorithm?

A

O(N*log(N))

61
Q

What is the midpoint given the quicksort on the list? Consider the lowindex = 5 and the highindex = 9.
(43, 3, 72, 18, 2, 28, 51, 111, 66, 71)

62
Q

What is the pivot point given the quicksort on this list? Consider the lowindex = 5 and the highindex = 9.
(43, 4, 72, 18, 2, 28, 51, 111, 66, 71)

63
Q

Which tool in python is used to implement a deque ADT?

A

Collections

64
Q

Which function in Python is used to delete one item on the right side of the deque?

65
Q

Which function determines that a linked list contains no data?

66
Q

What are classes composed of that perform the actions of an application?

67
Q

Which loop type will be done at least once?

68
Q

How would a strongly typed language create an integer variable?

69
Q

Which component of a case statement would be considered a fall back in case no other parameters are met?

70
Q

Which operator is a type of assignment operator?