CS301 Assignment 2 fall 2024 |cs301 assignment 2 solution 2024|cs301 assignment no 2 solution 2024

Опубликовано: 30 Октябрь 2024
на канале: Learning With Happy Mood
158
2

*whatsapp link*
https://chat.whatsapp.com/KJ61QyWmYIV...

how to download and install dev c++ in windows 7 8 10 for 32bit & 64bit | how to install dev c++
   • how to download and install dev c++ i...  
Assignment No. 2
Semester: Fall 2023
CS301 – Data Structures Total Marks: 20
Due Date: 8th Jan 2024


Instructions
Please read the following instructions carefully before submitting the assignment solution:
It should be clear that your assignment will not get any credit/marks if:
o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).

Recommended Tools
• Dev C++

Assignment Submission Instructions
You have to submit only “.cpp” file of your code on the assignments interface from your LMS account.
Assignment submitted in any other format will not be accepted and will be scaled with zero marks. No excuse will be accepted on submitting solution file in any other format.
For any query related to assignment, please contact [email protected].

Problem Statement:
You are working for a library that wants to efficiently keep track of books on its shelves. The library receives a constant stream of new books and returns. To maintain an organized record, you are asked to implement a data structure that combines a stack and a Binary Search Tree (BST) to manage the books efficiently.
You need to create a data structure called BookStack that incorporates a stack and a BST. The stack will keep track of the most recently added books, while the BST will maintain an ordered list of all the books in the library. The books in the BST should be ordered alphabetically by their title. You should implement the following functionalities:
• Implement a function to add a new book to the BookStack. This function should push the book onto the stack and insert it into the BST. The BST should be ordered based on the alphabetical order of the book titles.
• Create a function to remove the most recently added book from the BookStack. This function should also remove the corresponding book from the BST.
• Implement a search function that takes a book title as input and returns the book's details (if it exists in the library). This function should efficiently search the BST.
• Create a function to list all the books in the library in alphabetical order. This function should perform an in-order traversal of the BST.
You are required to create a program using C++ programming language to implement binary search tree (BST) with stack.
• Note: For the construction of BST use only class, the use of struct will be considered an invalid solution.
• Ensure that your VUID is used as the ISBN of the first book, which will be manually saved in the code. When you run the program and display the list of books, this data must be included in the output.
#cs301
#cs301_assignment_2
#learning_with_happy_mood