0% found this document useful (0 votes)
6 views2 pages

345956assignment 3 - Data Structures in Java-1754131461894

This document outlines an assignment on data structures in Java, specifically focusing on stacks, queues, and linked lists. It includes ten questions that cover fundamental concepts, operations, and comparisons between different data structures. Students are required to answer any five questions for a total of 25 marks.

Uploaded by

balramjat670
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)
6 views2 pages

345956assignment 3 - Data Structures in Java-1754131461894

This document outlines an assignment on data structures in Java, specifically focusing on stacks, queues, and linked lists. It includes ten questions that cover fundamental concepts, operations, and comparisons between different data structures. Students are required to answer any five questions for a total of 25 marks.

Uploaded by

balramjat670
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

Data Structures in Java

UNIT 3

Assignment
Note: Attempt any five questions from the following [5 Marks Each]

1.​ What is a stack, and how does it function?

2.​ Explain the difference between a queue and a circular queue.

3.​ How can you implement the basic operations (push and pop) on a stack?

4.​ Describe the steps involved in evaluating a postfix expression using a stack. How does this differ
from evaluating an infix expression?

5.​ Explain the process of converting an infix expression to its postfix and prefix forms. Provide an
example for each conversion.

6.​ What is a linked list, and how does it differ from a regular list? Discuss the different types of
linked lists and their use cases.

7.​ Explain the concept of dynamically linked stacks. How does the dynamic nature of a linked list
enhance the functionality of a stack? Provide an example to illustrate a dynamically linked
stack's implementation and memory management.

8.​ Describe the process of implementing a queue using a linked list. How do enqueue and dequeue
operations differ in a linked list-based queue compared to an array-based queue? Discuss the
benefits and potential drawbacks of using a linked list to represent a queue.

9.​ Compare and contrast linked lists with arrays and dynamic arrays. Discuss the scenarios where
linked lists are preferred over arrays and vice versa. Explain how arrays' dynamic resizing differs
from linked lists' dynamic nature, focusing on memory allocation and performance
considerations.

10.​ Discuss how a linked list can be used to represent a stack. Include a detailed explanation of the
operations (push, pop, and peek) on a stack implemented using a singly linked list. What are the
advantages and disadvantages of using a linked list over an array for stack implementation?

You might also like