IGNORE*****PA 1 Flashcards

1
Q

Which term refers to a template for creating an object?

Method
Algorithm
Application
Class
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?

Uses Windows to install the application
Uses MySQL for the database needs of the algorithm’s  application
Uses an agnostic code repository
Uses Python to implement the algorithm
A

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?

Array
Graph
Record
Matrix
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?

Modularity
Feasibility
Maintainability
Scalability
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?

Iteration
Looping
Sequencing
Finiteness
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?

Divide-and-conquer
Greedy
Linear
Quicksort
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?

Browser type
Database type
Finiteness
Simplicity
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?

Exponential search
Binary search
Linear search
Jump search
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?

Binary search
A priori analysis
A posteriori analysis
Linear search
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?

Extensibility
User adoption
Correctness
Flowchart
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?

Bubble search
Insertion search
Linear search
Binary search
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?

Merge
Recursive
Binary
Linear
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?

Efficiency analysis
Screen load times
Worst case
Memory usage
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?

String
Tree-based data structure
Number
Array
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?

Recursive
Do while loop
For loop
If statement
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?

Uses case statements
Uses for loops
Calls itself
Calls another function
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?

Double if
Internal 
Subscript
Nested
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?
Jump search
Linear search
Sequential search
Binary search
Jump Search

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?

Sequential search
List search
Linear search
Interval search
A

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?

Vertex
Data structure
Graph
Record
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?

Heap
List
Hash table
Queue
A

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

Queue
Head
Indexes
Priority
A

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

Overriding
Instantiation
Overloading
It consists of variables and methods.
A

It consists of variables and methods.

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

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

6,7,9,8
7,9,8,6
6,7,9
7,9,6
A

7,9,8,6

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

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

7,9,8
9
7
8
A

7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
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 ()

5,6,7
7,6,5
8,6,5
9,8,6
A

865

28
Q

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

7,9,8,3
3,7,9,8
3,9,8
7,9,3
A

7,9,8,3

29
Q

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

Graph
Doubly linked lists
Array
ArrayList
A

Array

30
Q

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

Hash table
Graph
Pointer
Record
A

Record

31
Q

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

Stack
List
Hash table
Dictionary
A

Hash table

32
Q

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

Grows and shrinks as needed
Faster search time
Allows for random access
Less memory needed for each element
A

Grows and shrinks as needed

33
Q

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

A singly linked list
A binary tree
A doubly linked list
An array
A

A doubly linked list

34
Q

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

Char
String
Tuple
List
A

List

35
Q

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

8,9,3,5,1
8,9,3,5
1,8,9,3,5
8,9,3,1
A

1,8,9,3,5

36
Q

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

4
1
3
8
A

8

37
Q

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

{82}
{69,82,47,11}
{69,82,47}
{11,82}
A

{82}

38
Q

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

2/N< 37<N log(N2) <N2<2N
2/N< 37<N2<2N<N log(N2)
N log(N2) <2/N< 37< N2<2N
2/N<N log(N2) <N2<2N< 37
A

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

39
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]

0
10
11
121
A

11

40
Q

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

6
9
11
20
A

9

41
Q

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?

3
6
32
64
A

6

42
Q

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?

0
3
6
4
A

6

43
Q

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

Linear
Logarithmic
Quadratic
Exponential
A

Exponential

44
Q

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

O(N^2)
O(N^N)
O(N)
N^325
A

O(N)

45
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

O(3)
O(N)
O(N^3)
O(N^2)
A

O(N^3)

46
Q

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

Array
String
Numeric
Char
A

Array

47
Q

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

Array
Queue
List
Stack
A

Stack

48
Q

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

enqueue
push
dequeue
peek
A

dequeue

49
Q

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

index()
count()
pop()
len()
A

count()

50
Q

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

len()
index()
print()
dict()
A

index()

51
Q

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

extend()
remove()
pop()
clear()
A

clear()

52
Q

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

List
String
Queue
Stack
A

Stack

53
Q

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

stack()
remove()
extend()
pop()
A

remove()

54
Q

How does the insertion sort algorithm sort through a list?

By comparing the target value to the element in the middle of the list
By performing an in-place comparison of the items in the list
By iterating through the sorted list while placing each value into its correct sorted position within the list
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

55
Q

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

O(N)
O(log(N))
O(N^)
O(N*log(N))
A

O(N*log(N))

56
Q

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)

9
7
6
4
A

7

57
Q

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)

111
28
71
51
A

111

58
Q

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

Abstraction
String
Collections
Robust
A

Collections

59
Q

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

pop()
extend()
index()
insert()
A

pop()

60
Q

Which function determines that a linked list contains no data?

peek()
insert()
put()
IsEmpty()
A

IsEmpty()

61
Q

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

Databases
JSON
XML
Methods
A

Methods

62
Q

Which loop type will always be done at least once?

Do while
While
For
Foreach
A

Do while

63
Q

How would a strongly typed language create an integer variable?

let big: number = 0
int myVar
Var myVar
String myVar
A

int myVar

64
Q

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

Else
Break
Continue
Default
A

Default

65
Q

Which operator is a type of assignment operator?
+
+=
==
||

A

+=