Kit Library

🎯 Exam Preparation Kit

Data Structures Exam Prep

English 28 leveled MCQs Free

Shared by a Veda learner · Generated with Veda AI

Smart notes

What you'll study, topic by topic

1

Data Structures Exam Prep

Full explanation, worked examples & memory tricks in the app

Solved paper preview

Sample questions with model answers

Every question in the paper gets a full exam-length answer in the app — organised by marks, the way a topper writes it.

7 marks Long answer

1. Define pointer in C 2. Define structure in C 3. Give the full form of DMA 4. Give the definition of linked list 5. Differentiate between doubly linked list and singly linked list (at least three points).

Show answer outline

Pointer: variable storing memory address; Structure: user-defined data type; DMA: Dynamic Memory Allocation; Linked List: collection of nodes; Doubly linked list has two pointers per node, singly linked list has one.

The full exam-length answer is in the app.

7 marks Long answer

Give limitation of simple queue. Explain concept of circular queue. Construct an algorithm for inserting element in simple queue.

Show answer outline

Limitation: fixed size; Circular queue allows reuse of empty spaces; Algorithm: adjust front and rear indices circularly.

The full exam-length answer is in the app.

7 marks Long answer

Draw BST for the following data: 30, 50, 29, 84, 66, 27, 19, 56. Find in-order, pre-order and post-order traversal for the same.

Show answer outline

BST: 30 as root, 29 left, 50 right, etc.; Traversals: in-order: 19, 27, 29, 30, 50, 56, 66, 84; pre-order: 30, 29, 19, 27, 50, 66, 56, 84; post-order: 19, 27, 29, 56, 66, 84, 50, 30.

The full exam-length answer is in the app.

7 marks Long answer

Define (or Explain) the following terms: 1. Primitive data structure 2. strcat() function of C 3. name any one application of stack 4. draw the figure of doubly linked list 5. out-degree of a tree 6. sorting 7. Big Oh.

Show answer outline

Primitive data structures: basic types; strcat(): concatenates strings; Stack application: expression evaluation; Doubly linked list: node structure with two links; Out-degree: number of edges from a node; Sorting: arranging data; Big Oh: notation for algorithm complexity.

The full exam-length answer is in the app.

7 marks Long answer

Write any three characteristics of an array. Explain row major and column major array.

Show answer outline

Characteristics: fixed size, indexed access, same data type; Row major stores rows in contiguous memory, column major stores columns.

The full exam-length answer is in the app.

7 marks Long answer

Justify the need of circular queue. Write an algorithm to delete an element from the queue.

Show answer outline

Circular queue prevents wastage of space; Algorithm: adjust front index and return element.

The full exam-length answer is in the app.

7 marks Long answer

Explain the process of converting general tree into binary tree. Draw binary tree for the following general tree.

Show answer outline

Convert each node to binary; draw binary representation.

The full exam-length answer is in the app.

7 marks Long answer

Construct an algorithm for quick sort. Also give the trace of quick sort for the following data: 25, 52, 37, 63, 14, 17, 8.

Show answer outline

Algorithm: choose pivot, partition array; Trace: show steps of sorting.

The full exam-length answer is in the app.

7 marks Long answer

Define hashing. Explain division method, mid square method and folding method.

Show answer outline

Hashing: mapping data to fixed-size values; Division: key mod table size; Mid square: square key, use middle digits; Folding: sum parts of key.

The full exam-length answer is in the app.

7 marks Long answer

Construct an algorithm for bubble sort. Give trace of bubble sort for following data: 37, 22, 64, 84, 58, 52, 11.

Show answer outline

Algorithm: repeatedly swap adjacent elements; Trace: show sorted steps.

The full exam-length answer is in the app.

4 marks Medium answer

Construct a program in C to reverse a string without using library function.

Show answer outline

Use a loop to swap characters from start to end until the middle is reached.

The full exam-length answer is in the app.

4 marks Medium answer

Write an algorithm for merge sort.

Show answer outline

Divide array into halves, sort each half, merge sorted halves.

The full exam-length answer is in the app.

4 marks Medium answer

Write an algorithm for binary search method.

Show answer outline

Compare target with middle element; if equal, return index; if less, search left half; if greater, search right half.

The full exam-length answer is in the app.

4 marks Medium answer

Construct an algorithm to insert a node at the first position in singly linked list.

Show answer outline

Create new node, set its next to head, update head to new node.

The full exam-length answer is in the app.

4 marks Medium answer

List different operations that can be performed on string. Write an algorithm to concatenate two strings into third one.

Show answer outline

Operations: length, comparison, concatenation; Algorithm: copy characters from both strings into third.

The full exam-length answer is in the app.

4 marks Medium answer

A binary tree T has 9 nodes. The in-order and pre-order traversal of tree T yields the following sequence. Find the binary tree. In-order: 5 1 3 11 6 8 4 2 7. Pre-order: 6 1 5 11 3 4 8 7 2.

Show answer outline

Construct tree using traversal sequences.

The full exam-length answer is in the app.

4 marks Medium answer

Differentiate between static memory allocation and dynamic memory allocation. (Give at least 4 differences).

Show answer outline

Static: fixed size, allocated at compile time; dynamic: variable size, allocated at runtime.

The full exam-length answer is in the app.

4 marks Medium answer

State the use of malloc() function. Explain it with example.

Show answer outline

malloc(): allocates memory dynamically; Example: int* arr = (int*)malloc(size * sizeof(int));

The full exam-length answer is in the app.

4 marks Medium answer

Write an algorithm to insert a node in ordered singly linked list.

Show answer outline

Traverse list, find position, insert node.

The full exam-length answer is in the app.

2 marks Short answer

Identify at least three differences between stack and queue.

Show answer outline

Stacks are LIFO, queues are FIFO; stacks allow push/pop, queues allow enqueue/dequeue; stacks use a single end, queues use both ends.

The full exam-length answer is in the app.

2 marks Short answer

Convert following prefix expression to postfix expression using stack: (a/b) * (c/(d+e)-f)

Show answer outline

(ab/cde+f-)*

The full exam-length answer is in the app.

2 marks Short answer

Define following: 1. DS 2. Time complexity 3. Algorithm.

Show answer outline

DS: data structure; Time complexity: measure of algorithm efficiency; Algorithm: step-by-step procedure for computation.

The full exam-length answer is in the app.

2 marks Short answer

Define following: 1. Root node 2. Forest 3. Leaf node.

Show answer outline

Root node: top node in a tree; Forest: collection of disjoint trees; Leaf node: node with no children.

The full exam-length answer is in the app.

2 marks Short answer

Write and explain algorithm for PUSH operation of stack data structure.

Show answer outline

Increment top index, assign value to stack[top].

The full exam-length answer is in the app.

2 marks Short answer

Explain scanf() and gets() functions with example.

Show answer outline

scanf(): reads formatted input; gets(): reads string until newline.

The full exam-length answer is in the app.

2 marks Short answer

Explain different tree traversal methods.

Show answer outline

Methods: in-order, pre-order, post-order.

The full exam-length answer is in the app.

2 marks Short answer

Explain with diagram: Complete Binary Tree & Strict Binary Tree.

Show answer outline

Complete: all levels filled except last; Strict: each node has 0 or 2 children.

The full exam-length answer is in the app.

2 marks Short answer

Write a C program to find sum of two 1D arrays.

Show answer outline

Iterate through arrays, sum corresponding elements.

The full exam-length answer is in the app.

Study it properly — free, in the app

The full Veda Bites deck, complete notes, spaced-repetition flashcards, leveled MCQs, tests and games for this kit — plus Daily Facts and the Arena, every day.