PA Flashcards

1
Q

Which term refers to a template for creating an object?

A: Application
B: Class
C: Algorithm
D: Method

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: Uses Python to implement the algorithm
B: Uses MySQL for the database needs of the algorithm’s application
C: Uses Windows to install the application
D: Uses an agnostic code repository

A

D: Uses 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: Array
B: Matrix
C: Record
D: Graph

A

C: 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: Scalability
B: Feasibility
C: Maintainability
D: Modularity

A

C: 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: Sequencing
B: Finiteness
C: Iteration
D: Looping

A

B: 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
B: Divide-and-conquer
C: Greedy
D: Quicksort

A

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
B: Database type
C: Finiteness
D: Browser type

A

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 array?

A: Binary search
B: Jump search
C: Exponential search
D: Linear search

A

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: Binary search
B: A posteriori analysis
C: A priori analysis
D: Linear search

A

B: 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: User adoption
B: Correctness
C: Extensibility
D: Flowchart

A

C: 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: Insertion search
B: Bubble search
C: Linear search
D: Binary search

A

D: 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: Recursive
B: Linear
C: Binary
D: Merge

A

C: 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: Memory usage
B: Efficiency analysis
C: Screen load times
D: Worst case

A

D: 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
B: Array
C: String
D: Number

A

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: For loop
B: If statement
C: Do while loop
D: Recursive

A

D: 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
B: Calls another function
C: Uses for loops
D: Uses case statements

A

A: Calls itself

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

What is xin 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: 20
B: 25
C: 100
D: 500

A

B: 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
B: Internal
C: Double if
D: Subscript

A

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: Sequential search
B: Binary search
C: Jump search
D: Linear search

A

B: 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: Sequential search
B: List search
C: Interval search
D: Linear search

A

C: Interval search

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

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

A: Data structure
B: Vertex
C: Record
D: Graph

A

A: Data structure

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

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

A: Heap
B: Hash table
C: List
D: Queue

A

B: Hash table

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

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

A: Head
B: Queue
C: Priority
D: Indexes

A

D: Indexes

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

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

A: Overloading
B: Instantiation
C: It consists of variables and methods.
D: Overriding

A

C: It consists of variables and methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the result when 6 is enqueued to the queue 7,9,8 (with 7 as the front)? A: 6,7,9,8 B: 7,9,8,6 C: 6,7,9 D: 7,9,6
B: 7,9,8,6
26
Which value would be returned from executing the dequeue operation on the queue 7,9,8 (with 7 as the front)?  A: 7,9,8 B: 9 C: 7 D: 8
C: 7
27
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 () A: 5,6,7 B: 7,6,5 C: 8,6,5 D: 9,8,6
C: 8,6,5
28
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 B: 3,7,9,8 C: 3,9,8 D: 7,9,3
A: 7,9,8,3
29
Which format is used to store data in a hash table? A: Graph B: Array C: ArrayList D: Doubly linked lists
B: Array
30
Which term refers to a data structure that groups related items of data together?  A: Pointer B: Graph C: Record D: Hash table
C: Record
31
Which data structure is used to store unordered items by mapping each item to a location in an array? A: Stack B: List C: Dictionary D: Hash table
D: Hash table
32
What is the advantage that a linked list has over an array?  A: Grows and shrinks as needed B: Allows for random access C: Less memory needed for each element D: Faster search time
A: Grows and shrinks as needed
33
What would be the best data structure for a hash table with simple chaining?  A: A binary tree B: A doubly linked list C: A singly linked list D: An array
B: A doubly linked list
34
How many leaf nodes does this tree have? A: One B: Two C: Three D: Four
B: Two
35
What is the root node for this tree? A: Anne B: Zara C: Savannah D: Peter
A: Anne
36
What is the height of this tree?  A: Four B: One C: Three D: Two
D: Two
37
Which data structure is the most dynamic in storing data items of varying lengths? A: Tuple B: List C: String D: Char
B: List
38
What is the resulting stack when the push(1) function is implemented on this stack yield? 8,9,3,5(top is 8) A: 8,9,3,5,1 B: 8,9,3,5 C: 1,8,9,3,5 D: 8,9,3,1
C: 1,8,9,3,5
39
What will the peek() operation from this stack return?  8,9,3,5(top is 8) A: 4 B: 1 C: 3 D: 8
D: 8
40
What is the set that results from set1 intersection set2, given these sets?  set1 = {69,82,47} set2 = {11,82} A: {82} B: {69,82,47,11} C: {69,82,47} D: {11,82}
A: {82}
41
How many vertices does this graph have?  A: Four B: Three C: Five D: Two
C: Five
42
What is the adjacency list for node 8 in this graph?  A: 10,7,9,3 B: 10,11,7,9,3 C: 11,7,9,3 D: 7,9,3
D: 7,9,3
43
What is the order of these functions by growth rate?  2/N,37,2N,N log(N2),N2 A: 2/N< 37
A: 2/N< 37
44
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] A: 0 B: 10 C: 11 D: 121
C: 11
45
What is the first element visited in this list when binary searching for the number 7?  [6,7,8,9,11,15,20] A: 6 B: 9 C: 11 D: 20
B: 9
46
How many elements in a list of size 64 would be visited when using a binary search for a number that is larger than all the values in the list?  A: 3 B: 6 C: 32 D: 64
B: 6
47
How many elements in a list of size 64 would be visited when using a binary search for a number that is smaller than all the values in the list?  A: 0 B: 3 C: 6 D: 4
C: 6
48
What is the runtime complexity of the algorithm O(N^N + 1)?  A: Logarithmic B: Linear C: Quadratic D: Exponential
D: Exponential
49
What is the runtime complexity for the expression 305 + O(325*N)?  A: O(N^2) B: N^325 C: O(N^N) D: O(N)
D: O(N)
50
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 A: O(3) B: O(N^2) C: O(N) D: O(N^3)
D: O(N^3)
51
Which term describes an abstract data type (ADT) that Python uses? A: Array B: Numeric C: String D: Char
A: Array
52
Which abstract data type (ADT) is characterized by the LIFO (last in, first out) principle? A: Array B: Stack C: Queue D: List
B: Stack
53
Which queue operation removes an item from the front of the queue?  A: dequeue B: enqueue C: push D: peek
A: dequeue
54
Which function in Python returns the number of times the desired value is found in a tuple?  A: index() B: len() C: count() D: pop()
C: count()
55
Which function in Python is used to find a specific value in a tuple?  A: index() B: len() C: print() D: dict()
A: index()
56
Which Python list function will remove all items from a list?  A: clear() B: remove() C: pop() D: extend()
A: clear()
57
Which abstract data type (ADT) allows operations at one end only? A: Stack B: List C: Queue D: String
A: Stack
58
Which Python list function removes the first instance of the specified element?  A: stack() B: pop() C: remove() D: extend()
C: remove()
59
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 B: By comparing the target value to the element in the middle of the list C: By performing an in-place comparison of the items in the list D: By performing the divide and conquer approach, which separates the list into two smaller arrays for comparison
A: By iterating through the sorted list while placing each value into its correct sorted position within the list
60
What is the average runtime complexity of the merge sort algorithm?  A: O(N) B: O(N^) C: O(log(N)) D: O(N*log(N))
D: O(N*log(N))
61
What is the midpoint given the quicksort on this list? Consider the lowindex = 5 and highindex = 9. (43,3,72,18,2,28,51,111,66,71) A: 9 B: 4 C: 6 D: 7
D: 7
62
What is the pivot point given the quicksort on this list? Consider the lowindex = 5 and highindex = 9. (43,3,72,18,2,28,51,111,66,71) A: 111 B: 28 C: 71 D: 51
A: 111
63
Which tool in Python is used to implement a deque ADT? A: Abstraction B: String C: Collections D: Robust
C: Collections
64
Which function in Python is used to delete one item on the right side of the deque? A: extend() B: pop() C: insert() D: index()
B: pop()
65
Which function determines that a linked list contains no data?  A: IsEmpty() B: peek() C: insert() D: put()
A: IsEmpty()
66
What are classes composed of that perform the actions of an application?  A: Databases B: JSON C: Methods D: XML
C: Methods
67
Which loop type will always be done at least once?  A: For B: Do while C: While D: Foreach
B: Do while
68
How would a strongly typed language create an integer variable?  A: Var myVar B: int myVar C: String myVar D: let big: number = 0
B: int myVar
69
Which component of a case statement would be considered a fall back in case no other parameters are met? A: Else B: Default C: Break D: Continue
B: Default
70
Which operator is a type of assignment operator?  A: + B: += C: == D: ||
B: +=