What is the primary purpose of an algorithm?
An algorithm is a step-by-step procedure used for calculations, data processing, and automated reasoning tasks.
Which data structure is most suitable for implementing a LIFO (Last In, First Out) principle?
LIFO means the last element inserted is the first one to be removed.
What is a binary search algorithm?
A binary search algorithm is a method of finding an element in a sorted array or list by repeatedly dividing the search interval in half.
What is the time complexity of an algorithm that performs a linear search in an unsorted array?
Linear search checks each element in sequence to find the target value.
Which of the following is a non-linear data structure?
Non-linear data structures allow elements to be connected in a hierarchical or graph-based way.
What is the space complexity of a recursive algorithm?
Recursive algorithms use additional space for each recursive call, usually in the form of a stack frame.
Loading Questions...
Which of the following is an example of a divide-and-conquer algorithm?
Divide-and-conquer algorithms break the problem into smaller sub-problems and solve each one recursively.
What is the primary use case of a hash table?
Hash tables provide efficient data retrieval based on keys using a hashing function.
What does O(log n) time complexity represent?
Algorithms with O(log n) time complexity reduce the problem size exponentially at each step, like in binary search.