Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  GATE Computer Science Engineering(CSE) 2025 Mock Test Series  >  Test: Programming & Data Structures - 2 - Computer Science Engineering (CSE) MCQ

Test: Programming & Data Structures - 2 - Computer Science Engineering (CSE) MCQ


Test Description

10 Questions MCQ Test GATE Computer Science Engineering(CSE) 2025 Mock Test Series - Test: Programming & Data Structures - 2

Test: Programming & Data Structures - 2 for Computer Science Engineering (CSE) 2024 is part of GATE Computer Science Engineering(CSE) 2025 Mock Test Series preparation. The Test: Programming & Data Structures - 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Programming & Data Structures - 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Programming & Data Structures - 2 below.
Solutions of Test: Programming & Data Structures - 2 questions in English are available as part of our GATE Computer Science Engineering(CSE) 2025 Mock Test Series for Computer Science Engineering (CSE) & Test: Programming & Data Structures - 2 solutions in Hindi for GATE Computer Science Engineering(CSE) 2025 Mock Test Series course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Programming & Data Structures - 2 | 10 questions in 30 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study GATE Computer Science Engineering(CSE) 2025 Mock Test Series for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Programming & Data Structures - 2 - Question 1

In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is

Detailed Solution for Test: Programming & Data Structures - 2 - Question 1

In the worst case, the element to be searched has to be compared with all elements of linked list.

Test: Programming & Data Structures - 2 - Question 2

Which of the following is FALSE about B/B+ tree

Detailed Solution for Test: Programming & Data Structures - 2 - Question 2

Asymptotic time complexity of both is of order logn.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Programming & Data Structures - 2 - Question 3

Let A be a square matrix of size n x n. Consider the following program. What is the expected output?

C = 100

for i = 1 to n do

    for j = 1 to n do

    {

        Temp = A[i][j] + C

        A[i][j] = A[j][i]

        A[j][i] = Temp - C

    } 

for i = 1 to n do

    for j = 1 to n do

        Output(A[i][j]);

Detailed Solution for Test: Programming & Data Structures - 2 - Question 3

If we take look at the inner statements of first loops, we can notice that the statements swap A[i][j] and A[j][i] for all i and j. Since the loop runs for all elements, every element A[l][m] would be swapped twice, once for i = l and j = m and then for i = m and j = l. Swapping twice means the matrix doesn’t change.

Test: Programming & Data Structures - 2 - Question 4

The order of an internal node in a B+ tree index is the maximum number of children it can have. Suppose that a child pointer takes 6 bytes, the search field value takes 14 bytes, and the block size is 512 bytes. What is the order of the internal node?

Detailed Solution for Test: Programming & Data Structures - 2 - Question 4

Key size = 14 bytes (given)
Child pointer = 6 bytes (given)
We assume the order of B+ tree to be ‘n’.
Block size = (n – 1) * key size + n * child pointer
512 >= (n – 1) * 14 + n * 6
512 >= 14 * n – 14 + 6 * n
n = (512 + 14) / 20
n = 526 / 20
n = 26.3
n = 26

Thus, option (C) is correct.

Test: Programming & Data Structures - 2 - Question 5

Given a hash table T with 25 slots that stores 2000 elements, the load factor α for T is __________

Detailed Solution for Test: Programming & Data Structures - 2 - Question 5

load factor = (no. of elements) / (no. of table slots) = 2000/25 = 80

Test: Programming & Data Structures - 2 - Question 6

Let P be a singly linked list. Let Q be the pointer to an intermediate node x in the list. What is the worst-case time complexity of the best known algorithm to delete the node x from the list?

Detailed Solution for Test: Programming & Data Structures - 2 - Question 6

A simple solution is to traverse the linked list until you find the node you want to delete. But this solution requires pointer to the head node which contradicts the problem statement.

Fast solution is to copy the data from the next node to the node to be deleted and delete the next node. Something like following.

// Find next node using next pointer
struct node *temp  = node_ptr->next;

// Copy data of next node to this node
node_ptr->data  = temp->data;

// Unlink next node
node_ptr->next  = temp->next;

// Delete next node
free(temp);

Time complexity of this approach is O(1)

Test: Programming & Data Structures - 2 - Question 7

An advantage of chained hash table (external hashing) over the open addressing scheme is

Detailed Solution for Test: Programming & Data Structures - 2 - Question 7

In Open Addressing scheme sometimes though element is present we can't delete it if empty bucket comes in between while searching for that element. External hashing scheme is free from this limitations. Hence, Option c is correct answer. 

Test: Programming & Data Structures - 2 - Question 8

Consider the following conditions:
(a)The solution must be feasible, i.e. it must satisfy all the supply and demand constraints.
(b)The number of positive allocations must be equal to m1n21, where m is the number of rows and n is the number of columns.
(c) All the positive allocations must be in independent positions.
The initial solution of a transportation problem is said to be non-degenerate basic feasible solution if it satisfies:
Codes:

Detailed Solution for Test: Programming & Data Structures - 2 - Question 8

The initial solution of a transportation problem is said to be non-degenerate basic feasible solution if it satisfies:
(a)The solution must be feasible, i.e. it must satisfy all the supply and demand constraints.
(b)The number of positive allocations must be equal to m1n21, where m is the number of rows and n is the number of columns.
(c) All the positive allocations must be in independent positions.
So, option (D) is correct.

Test: Programming & Data Structures - 2 - Question 9

The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is

Detailed Solution for Test: Programming & Data Structures - 2 - Question 9

When five items: A, B, C, D, and E are pushed in a stack: Order of stack becomes: A, B, C, D, and E (A at the bottom and E at the top.) stack is popped four items and each element is inserted in a queue: Order of queue: B, C, D, E (B at rear and E at the front) Order of stack after pop operations = A Two elements deleted from the queue and pushed back on the stack: New order of stack = A, E, D(A at the bottom, D at the top) As D is on the top so when pop operation occurs D will be popped out.
So, correct option is (D).

Test: Programming & Data Structures - 2 - Question 10

Which of the following correctly declares an array?

Detailed Solution for Test: Programming & Data Structures - 2 - Question 10

Option A is correct. Int is the data type used,geeks is the name of the array and [20] is the size of the array.

55 docs|215 tests
Information about Test: Programming & Data Structures - 2 Page
In this test you can find the Exam questions for Test: Programming & Data Structures - 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Programming & Data Structures - 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)