What is the time complexity of searching an element from a set of n elements using a Binary Search algorithm?
Solve the following recurrence using Master's theorem:
T(k) = 4T(k/2) + k!
If a simple graph G contains n vertices and m edges, the number of edges in the graph G' (the complement of G) is:
A binary search tree in which the difference in height between the left and right subtrees of any node is at most 1 is called?
In a linked list implementation of a queue, where is a new element inserted?
What is the Big O analysis of the running time (in terms of m) for the following program?
For (x=0; x< m; x++)
For (y=x; y< m; y++)
For (z=y; z< m; z++)
p++;
The fastest time in which the kth root of a number N (up to a given precision p) can be computed is approximately:
(The nth root of a number a refers to a1/n )
Consider the following definition in C programming language:
struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;
Which of the following C code is used to create a new node?
Given the program of naïve method for matrix multiplication:
for a=1 to m do
for b=1 to m do
Z[a][b]=0;
for c=1 to m do
Z[a][b] = Z[a][b] + X[a][c] * Y[c][b]
Fill in the blanks with the appropriate formula.
Define Rn to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i>0, let p[i] denote the selling price of a rod whose length is i meters. Consider the array of prices:
p[1]=1, p[2]=5, p[3]=8, p[4]=9, p[5]=10, p[6]=17, p[7]=18
Which of the following statements is/are correct about R7?