0% found this document useful (0 votes)
8 views1 page

2 - Marks - DS - Question and Answers

The document provides a series of questions and answers related to data structures, specifically focusing on Abstract Data Types (ADT), doubly linked lists, stack conditions, and applications of lists and queues. It explains the advantages of doubly linked lists, underflow and overflow conditions in stacks, and how to represent a singly linked list as a circular linked list. Additionally, it includes a routine for inserting an element into a queue.

Uploaded by

saishrish817
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

2 - Marks - DS - Question and Answers

The document provides a series of questions and answers related to data structures, specifically focusing on Abstract Data Types (ADT), doubly linked lists, stack conditions, and applications of lists and queues. It explains the advantages of doubly linked lists, underflow and overflow conditions in stacks, and how to represent a singly linked list as a circular linked list. Additionally, it includes a routine for inserting an element into a queue.

Uploaded by

saishrish817
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Question and Answers – (2 marks)

1. What is ADT? Give an example


ADT (Abstract Data Type):
An ADT is a mathematical model for a data structure that defines operations without
specifying implementation details. Example: Stack, which supports operations like
push, pop, and peek.
2. What is the advantage of doubly linked list?
Advantages of Doubly Linked List:
• Can be traversed in both directions.
• Efficient insertion and deletion at both ends.
• No need to traverse from the head for deletion at the tail.
3. Write the underflow and overflow conditions in stack?
Stack Underflow & Overflow Conditions:
• Underflow: Occurs when trying to pop from an empty stack.
• Overflow: Occurs when trying to push onto a full stack (in fixed-size stacks).
4. Write the applications of the list
Applications of List:
• Dynamic memory allocation.
• Implementation of stacks and queues.
• Used in databases and file systems.
• Polynomial arithmetic and sparse matrices.
5. What are the applications of queue?
Applications of Queue:
• CPU scheduling and disk scheduling.
• Printer spooling.
• Network data packet management.
• Call center customer service.
6. How will you represent a singly linked list as a circular linked list?
Singly Linked List as Circular Linked List:
To convert a singly linked list to a circular linked list, set the last node’s next pointer
to the head node instead of NULL.
7. Explain multi list in short
Multi List:
A multi list is a complex linked list where nodes may belong to multiple lists. It is
used in applications like database indexing and sparse matrices.
8. Write the routine to insert an element onto a queue.
Queue Insertion (Enqueue) Routine:
void enqueue(int value) {
if (rear == MAX - 1)
printf("Queue Overflow");
else {
rear++;
queue[rear] = value;
if (front == -1)
front = 0;
}
}

You might also like