In Depth First Search, how many times is each node visited?
What is the asymptotic time complexity to insert an element at the second position in a linked list?
Find the pivot element from the given input using the median-of-three partitioning method.
Input: 8, 1, 4, 9, 6, 3, 5, 2, 7, 0
What is the formula to compute the transitive closure of a graph?
What does the following recursive function do for a given Linked List with the first node as head?
What are the updated values of h and l in the array if the element being searched is lower than the value at the calculated index in interpolation search? (p = current position)
The time complexity of the following recursive implementation to find the factorial of a number is:
int fact(int m)
{
if (m == 0)
return 1;
return m * fact(m - 1);
}
int main()
{
int m = 6;
int ans = fact(m);
printf("%d",ans);
return 0;
Choose the correct statement about the following code segment:
bool check(int M)
{
if (M & (1 << J))
return true;
else
return false;
}
The time complexity of interpolation search is O(log log n) when the input array has uniformly distributed values and is sorted.
Select the code snippet which performs unordered linear search iteratively.