Q. What is the assumption of linearity in linear regression?
-
A.
The relationship between the independent and dependent variables is linear
-
B.
The residuals are normally distributed
-
C.
The independent variables are uncorrelated
-
D.
The dependent variable is categorical
Solution
The assumption of linearity states that the relationship between the independent and dependent variables should be linear.
Correct Answer:
A
— The relationship between the independent and dependent variables is linear
Learn More →
Q. What is the average case time complexity of binary search?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
The average case time complexity of binary search is O(log n).
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity for inserting an element at the beginning of a linked list?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
Inserting an element at the beginning of a linked list is done in constant time, O(1).
Correct Answer:
A
— O(1)
Learn More →
Q. What is the average time complexity for inserting an element at the end of a dynamic array?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
While inserting at the end is O(1) on average, it can be O(n) when the array needs to be resized.
Correct Answer:
B
— O(n)
Learn More →
Q. What is the average time complexity for inserting an element in a balanced binary search tree?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
In a balanced binary search tree, the average time complexity for insertion is O(log n).
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity for insertion in a Red-Black tree?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
The average time complexity for insertion in a Red-Black tree is O(log n) due to its balanced structure.
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity for searching an element in a sorted array using binary search?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
Binary search divides the array in half each time, leading to a time complexity of O(log n) for searching.
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity for searching an element in a stack?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
Searching for an element in a stack has an average time complexity of O(n) because you may need to traverse the entire stack.
Correct Answer:
B
— O(n)
Learn More →
Q. What is the average time complexity for searching an element in an unsorted array?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n log n)
Solution
In an unsorted array, you may need to check each element, leading to an average time complexity of O(n).
Correct Answer:
B
— O(n)
Learn More →
Q. What is the average time complexity for searching in an AVL tree?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
The average time complexity for searching in an AVL tree is O(log n) due to its balanced structure.
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity of accessing an element in a queue implemented using a linked list?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
Accessing the front element of a queue implemented using a linked list takes O(1) time, as it points directly to the head of the list.
Correct Answer:
A
— O(1)
Learn More →
Q. What is the average time complexity of accessing an element in a queue?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
Accessing the front element of a queue is done in constant time, O(1), as it does not require traversal.
Correct Answer:
A
— O(1)
Learn More →
Q. What is the average time complexity of accessing an element in an array?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n log n)
Solution
Accessing an element in an array by index is a constant time operation, O(1).
Correct Answer:
A
— O(1)
Learn More →
Q. What is the average time complexity of binary search?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
The average time complexity of binary search is O(log n), as it consistently halves the search space.
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity of inserting a node in a balanced binary search tree?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
In a balanced binary search tree, the average time complexity for insertion is O(log n).
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity of inserting an element into a hash table?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n log n)
Solution
Inserting an element into a hash table typically takes constant time on average, so the average time complexity is O(1).
Correct Answer:
A
— O(1)
Learn More →
Q. What is the average time complexity of Merge Sort?
-
A.
O(n)
-
B.
O(n log n)
-
C.
O(n^2)
-
D.
O(log n)
Solution
Merge Sort has an average time complexity of O(n log n) due to its recursive division of the array.
Correct Answer:
B
— O(n log n)
Learn More →
Q. What is the average time complexity of Quick Sort?
-
A.
O(n log n)
-
B.
O(n^2)
-
C.
O(log n)
-
D.
O(n)
Solution
The average time complexity of Quick Sort is O(n log n) due to its divide-and-conquer approach.
Correct Answer:
A
— O(n log n)
Learn More →
Q. What is the average time complexity of quicksort?
-
A.
O(n)
-
B.
O(n log n)
-
C.
O(n^2)
-
D.
O(log n)
Solution
The average time complexity of quicksort is O(n log n), making it efficient for large datasets.
Correct Answer:
B
— O(n log n)
Learn More →
Q. What is the average time complexity of searching for an element in a balanced binary search tree?
-
A.
O(1)
-
B.
O(log n)
-
C.
O(n)
-
D.
O(n log n)
Solution
The average time complexity for searching in a balanced binary search tree is O(log n).
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity of searching for an element in a binary search tree?
-
A.
O(1)
-
B.
O(log n)
-
C.
O(n)
-
D.
O(n log n)
Solution
In a balanced binary search tree, the average time complexity for searching is O(log n).
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity of searching for an element in a sorted array using binary search?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
Binary search divides the array in half each time, leading to a time complexity of O(log n) for searching.
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average time complexity of searching for an element in a stack?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
Searching for an element in a stack has an average time complexity of O(n) because you may need to traverse the entire stack.
Correct Answer:
B
— O(n)
Learn More →
Q. What is the average time complexity of searching for an element in an unsorted array?
-
A.
O(1)
-
B.
O(n)
-
C.
O(log n)
-
D.
O(n^2)
Solution
In an unsorted array, you may need to check each element until you find the target, leading to an average time complexity of O(n).
Correct Answer:
B
— O(n)
Learn More →
Q. What is the average time complexity of the Quick Sort algorithm?
-
A.
O(n)
-
B.
O(n log n)
-
C.
O(n^2)
-
D.
O(log n)
Solution
The average time complexity of Quick Sort is O(n log n) due to its divide-and-conquer approach.
Correct Answer:
B
— O(n log n)
Learn More →
Q. What is the average-case time complexity for searching in a Red-Black Tree?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(n log n)
-
D.
O(1)
Solution
The average-case time complexity for searching in a Red-Black Tree is O(log n) due to its balanced structure.
Correct Answer:
B
— O(log n)
Learn More →
Q. What is the average-case time complexity of quicksort?
-
A.
O(n)
-
B.
O(n log n)
-
C.
O(n^2)
-
D.
O(log n)
Solution
The average-case time complexity of quicksort is O(n log n) due to the divide-and-conquer approach.
Correct Answer:
B
— O(n log n)
Learn More →
Q. What is the balance factor of a node in an AVL tree?
-
A.
Height of left subtree - Height of right subtree
-
B.
Height of right subtree - Height of left subtree
-
C.
Number of nodes in left subtree - Number of nodes in right subtree
-
D.
Number of nodes in right subtree - Number of nodes in left subtree
Solution
The balance factor of a node in an AVL tree is calculated as the height of the left subtree minus the height of the right subtree.
Correct Answer:
A
— Height of left subtree - Height of right subtree
Learn More →
Q. What is the best-case time complexity of binary search?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(1)
-
D.
O(n log n)
Solution
In the best case, the target element is found at the middle of the array, resulting in a time complexity of O(1).
Correct Answer:
C
— O(1)
Learn More →
Q. What is the best-case time complexity of Insertion Sort?
-
A.
O(n log n)
-
B.
O(n^2)
-
C.
O(n)
-
D.
O(log n)
Solution
The best-case time complexity of Insertion Sort is O(n) when the array is already sorted.
Correct Answer:
C
— O(n)
Learn More →
Showing 1021 to 1050 of 3237 (108 Pages)