What is the time complexity of the following code snippet?
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << "Hello!" << endl;
}
}
Which sorting algorithm has the worst-case time complexity of O(n2)?
Which data structure follows the LIFO (Last-In-First-Out) principle?
What is the output of the following code snippet?
int x = 5;
int y = ++x + x++;
cout << y << endl;
What is the time complexity of searching an element in a sorted and rotated array of size n using binary search?
Which of the following is not a type of graph traversal algorithm?
Which of the following is not a property of a binary search tree (BST)?
What is the output of the following code snippet?
int arr[] = {1, 2, 3, 4, 5};
cout << arr[5] << endl;
Which of the following data structures is best suited for implementing a queue?
What is the time complexity of finding the maximum element in a max-heap?
Which sorting algorithm is based on the divide-and-conquer technique?
Which of the following is not a type of recurrence relation used in analyzing recursive algorithms?