LawMint Sign in

TNSET Data Structures and Algorithms Previous Year Questions

Try the preview and open any solution for a worked explanation.

TNSET practice pack

The practice pack for TNSET is coming soon to LawMint.

Question 1

Single array a[0 : MAXSIZE - 1] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top 1 and top 2 (top 1 < top 2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently,
the condition for "stack full" is __________.

Select one answer

Question 2

What is the output of the following code?
my_recursive_function(n)
{
    if (n == 0)
        return
    print(n)
    my_recursive_function(n - 1);
}
my_recursive_function(10)
Select one answer

Question 3

The worst case running time to search for an element in a balanced binary search tree with n2n elements is __________.

Select one answer

Question 4

The depth first search will use __________ as a structure to hold nodes for further processing.

Select one answer

Question 5

Covid(n)
{
    a = 1;
    for (i is 1 to n)
    {
        if (i <= n/2)
        {
            for (j is 1 to i)
                a = a + i;
        }
        else
        {
            a = a * i;
        }
    }
}
Running time of Covid(n) is
Select one answer

Question 6

Match the following:
List IList II
(1) PUSH(a) STACK
(2) FIFO(b) Stack insertion
(3) POP(c) QUEUE
(4) LIFO(d) Stack deletion
Select one answer

Question 7

The breadth first search will use a __________ as a structure to hold nodes for further processing.

Select one answer

Question 8

Match the following:
List IList II
1. Divide and conquer(a) Dijkstra's shortest path algorithm
2. Dynamic programming(b) Tic-tac-toe
3. Greedy Approach(c) Binary Search tree
4. Back tracking(d) Control theory
Select one answer

Question 9

What is the final value of the postfix expression B C D A D − + − +,
where A = 2, B = 3, C = 4, D = 5?

Select one answer

Question 10

Which of the following formula is used to find the address of aij a_{ij} in a m×n m \times n matrix, when the elements are stored in row major order?

Select one answer

Continue practising

The practice pack for TNSET is coming soon to LawMint.

TNSET practice pack

The practice pack for TNSET is coming soon to LawMint.