1/147
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Binary tree
Which type of tree is a tree in which each node has zero, one, or two children?
Node
What is a common name of a class a programmer would define to implement a linked list?
It has numeric values associated with the edges.
What distinguishes a weighted graph from other types of graphs?
A collision occurs.
What happens when a hash function returns the same output for different inputs in a hash table?
O(1)
What is the time complexity of a lookup operation in a hash table when there are no collisions?
A tree where each node has zero, one, or two children, and all left descendants are less than the node
What is a binary search tree?
The new node becomes the root.
What is the first step when inserting a new node into a binary search tree that does not have a root?
Ascending order
Which order will the output be in when performing in-order traversal on a binary search tree?
Binary search
Which type of search algorithm is coded by defining the first and last index positions of an ordered list so that the middle position can be calculated?
Merge sort algorithm
Which type of sorting algorithm divides data recursively in two parts until each list has only one element?
Quicksort
Which type of sorting algorithm uses a partition technique called pivot?
To sort an unsorted collection of elements in order
What is the primary purpose of sorting algorithms in computer science?
By going through the list and swapping where necessary
How does bubble sort ensure that the highest value reaches the last position in the list?
The lower value
Which value is shifted to the left in an insertion sort?
Get
Method used to remove and return an element from a SImpleQueue.
Push it to the stack
What should be done when an opening symbol such as ('(', '[', or '{') is found within a stack when checking the correctness of parentheses.
A stack-like behavior
What does the LifoQueue class from Python's queue module provide?
O(V + E)
The time complexity of the breadth-first search algorithm when applied to graphs.
O(n)
The time complexity of the breadth-first search algorithm when applied to binary trees?
When the queue is empty
When would a user stop iterating through the nodes in Breadth-First Search?
The index for the partition element
What does the partition function return when implementing Quicksort in Python?
O(log n)
What is the space complexity of Quicksort?
O(n log n)
What is the time complexity of Quicksort
When first_index is equal to last_index
What is the base condition for the recursive calls to stop in the Quicksort algorithm?
The first row
What does 'arr[0]' return if 'arr' is a 2D numpy array?
2
What is the result of the following operation: np.array([[1, 2], [3, 4]])[0][1]?
np.zeros((3, 3))
How could someone create a 2D NumPy array with dimensions 3x3 filled with zeros?
data[0:2, 0:2]
What is the correct way to select a sub-array from the first two rows and first two columns of a 2D array named "data"?
data.cumsum()
How can you calculate the cumulative sum of the elements in a NumPy array named "data"?
np.median(data)
What is the correct way to calculate the 50th percentile (median) of a NumPy array named "data"?
np.median(arr)
Which NumPy method is an example used to find the middle value of the NumPy array np?
A concatenated list is produced.
What is the expected output of using + between two lists?
print(numpy_array[6:11])
What code would print a sub array of the elements at indices 6 through 10 in numpy_array?
np.array(list)
What is the correct way to create a NumPy array from a Python list?
Only values of a single type.
What type of values can a NumPy array contain?
It selects elements corresponding to True in the boolean array.
What is the result of using a boolean array for subsetting a NumPy array?
The entire second row
What is the result of subsetting a NumPy array using array[1, :]?
array[0:2, 0:2]
How can someone subset the first two rows and the first two columns of a 2D NumPy array?
array[1, 2]
Which code snippet is a correct way to perform subsetting on a 2D numpy array to get a single element?
numpy.random.rand
What is the name of the function in NumPy used for generating random numbers?
They can perform calculations faster.
What is a consequence of NumPy arrays being able to contain only one data type?
A NumPy array containing booleans indicating if each element meets the condition
What is the result of using the greater than sign '>' on a NumPy array?
Because it assumes all elements are of a single type
What is the primary reason NumPy can perform calculations so quickly?
A new list with the elements concatenated
What is the output of 'python_list + python_list' if 'python_list' is a regular Python list?
np.array(heights)
How is a NumPy array created from a Python list named 'heights'?
np.median(data)
Which NumPy function can be used to summarize a dataset with a single value representing its central tendency?
It reduces computation time for large datasets
What is the primary benefit of NumPy's speed advantage in numerical computations?
It controls the standard deviation of the output.
'''python
scores = np.random.normal(1.75, 0.20, 5000)
'''
What is the role of the second parameter in the above line of code?
All elements will be converted to string.
What is the expected result if one float element in a NumPy array is converted to a string?
It is equipped with a digital signature.
Feature that causes a device driver to be a 'signed' driver?
data[2, 3]
What is the correct way to select the element in the third row and fourth column of a 2D array named "data"?
del list[0]
Which Python code will delete the first value in a list (list name list)?
Binary search is much more efficient than Linear search.
What is the relative level of complexity when comparing Linear search to Binary search?
Unallocated
How would a new hard drive that has never been used be indicated in the Windows Disk Management Utility?
Delete it.
What should be done if the node to be deleted in a binary search tree has no children?
Left subtree, current node, right subtree
Which sequence reflects the order of visitation for an in-order traversal of a binary tree?
left subtree, Right subtree, current node
Which sequence reflects the order of visitation for an post-order traversal of a binary tree?
Current node, left subtree, right subtree
Which sequence reflects the order of visitation for an pre-order traversal of a binary tree?
O(n^2)
Which notation describes the complexity of n operations within a pair of nested loops?
Embedded OS
What is the type of operating system found on a kiosk, bank cash machine, or industrial machine?
It separates the rows and columns in the array.
What is the purpose of the comma in the following code snippet?
```python
import numpy as np
np_x = np.array(x)
np_x[:, 0]
```
The elements are pasted together, generating a longer list.
What happens when two Python lists are added together using the '+' operator?
"dat"
What is the result of print(msg[-10:-7]) be when msg = "Updating Now"?
The current node becomes current node's left child.
What happens if the search value is less than the current node's data during a search operation?
Files will inherit the permissions of the parent folder
What is the result of creating files in a read-only folder?
The lowest value
What is the pointer looking for as it moves through the list in a selection sort?
array[-1, :]
How can a user subset the last row of a 2D NumPy array?
import numpy as np
How is the NumPy package imported into a Python session?
The element in the second row and second column
What does array[1, 1] return in a 2D NumPy array?
capitalize()
Which Python method will replace the first letter of a string with a capital letter and convert all other letters to lowercase?
An error
What will be the result of adding an integer to a string in Python?
DIR
What command in the command prompt in Windows allow a user to display the file list of their current directory?
To specifies the new value
What is the purpose of the second input in the method stateNames.replace("ca", "CA")?
np.array([[1, 2], [3, 4]])
How can a 2D NumPy array be created from a list of lists in Python?
x = 99
Which Python statement correctly assigns the value 99 to a variable?
One
How many different data types are allowed in a given NumPy array?
File extension
What indicates the type of file or the application that can be used to access it?
The shell
Which component of the operating system is responsible for accepting user commands?
np.median(np_stats[:, 0])
What Python code would return the median height in np_stats where np_stats = np.array([[6.1,200],[5.5,130],[5.9,155]])?
The advanced security
What is one advantage of FreeBSD over Linux?
With square brackets
How can a Python list be built?
pow()
Which function would allow the user to calculate a number squared?
print(5 - 3)
Which Python code will print the results of 3 subtracted from 5?
O(n^2)
What is the time complexity of a selection sort algorithm?
O(n^2)
What is the time complexity of a insertion sort algorithm?
O(n^2)
What is the time complexity of a bubblesort algorithm?
O(n log n)
What is the time complexity of a quicksort algorithm?
O(n log n)
What is the time complexity of a mergesort algorithm?
An element-wise sum of the arrays.
What is the result of adding two NumPy arrays together using the '+' operator?
type(variable)
What is the method for checking the data type of a variable in Python?
Linked List
Which type of data structure could be Singly or Doubly?
[]
What is the slicing outcome of client_locations[2:2] from client_locations = ["TX", "AZ", "UT", "NY"]?
Lists
What does the NumPy package provide an alternative to in Python?
The head
What is the first element of each node in a linked list?
The kernel
Which component of the operating system is responsible for acting as the interface between applications and the hardware itself?
Files
What are smallest units of storage that can be stored on any storage medium from a general user's perspective?
np.array([2, 4, 6, 8, 10])
What is the correct way to create a NumPy array with values ranging from 2 to 10 in increments of 2?
The number of rows and columns in the array
What does the shape attribute of a numpy array indicate?
Array([24])
What is the expected output of the following code?
numpy_array[numpy_array > 23] where numpy_array = ([21,20,21,24,22])
Compare the first and second elements
What is the first step in the insertion sort algorithm?