DATA STRUCTURE Programming and Technical Logical Reasoning Decision Making and Problem Solving

Vrinda writes an efficient program to sum two square diagonal matrices
(matrices with elements only on diagonal). The size of each matrix is nXn. What is the
time complexity of Vrinda's algorithm?

Read Solution (Total 6)

DATA STRUCTURE Other Question

A linked list is of a length specified in its declaration. True or False ? Consider the following code:
function modify(w,u)
{
w = w + 2
u = u - 3
return (w - u)
}
function calculate( )
{
integer a = 10, b = 20, c
c = modify(a, b);
print a
print space
print b
}
Assume that a was passed by value and b was passed by reference. What will be the
output of the program on executing function calculate( ) ?

Op 1: 12 17
Op 2: 10 17
Op 3: 12 20
Op 4: 10 20