What is the best case time complexity of Heap sort?
Which notation provides a strict upper bound for f(n)?
What is the worst-case time and space complexity of insertion sort?
The asymptotic notation used to define the average time complexity is called:
What does the Morse code signal of 3 dots, 3 dashes, and 3 dots represent?
Consider a complete binary tree where the left and the right subtrees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap is
Which graph traversal algorithm can be used to most efficiently determine the presence of a cycle in a given graph?
What is the output of the following C code?
int fac(int b)
{
if(b == 0)
return 1;
return b * fac(b - 1);
}
int main()
{
int b = 8;
int answer = fac(b);
printf("%d",answer);
return 0;
}
A queue is implemented using a non-circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let n denote the number of nodes in the queue. Let 'enqueue' be implemented by inserting a new node at the head, and 'dequeue' be implemented by deletion of a node from the tail.
Which one of the following is the time complexity of the most time-efficient implementation of 'enqueue' and 'dequeue, respectively, for this data structure?
Consider the code given below, which runs insertion sort:
void insertionSort(int arr[], int array_size)
{
int i, j, value;
for (i = 1; i < array_size; i++)
{
value = arr[i];
j = i;
while (j > 0 && arr[j - 1] > value)
{
arr[j] = arr[j - 1];
j = j - 1;
}
arr[j] = value;
}
}
Which condition will correctly implement the while loop?
OnSite
1 Openings
FullTime
Posted 17 days ago