Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assign each data structure to at least one scenario( Array, Queue, Stack, Linked

ID: 3576508 • Letter: A

Question

Assign each data structure to at least one scenario( Array, Queue, Stack, Linked List, Binary Tree, Heap (Priority Queue), Hashtable, Graph). Explain:

1. why you chose the data structure.

2. whether you would use java's implementation of the data structure.

3. describe why the data structure is the best for efficiency.

Scenerio 6. A library wants to keep track of all of its books by title and availability. If a book is not in their collection, then it should not be stored. Books are added and removed from the collection daily. A book is checked out or returned every 10 seconds or so.

"My guess is that its either a Hashmap or Binary Tree... but im not sure."

Explanation / Answer

Computers are capable to solve problems very fast for the small problems, what if the problem is getting complex? And to solve those in quickest way possible?

While solving complex problems it has to store several variables and values in the memory (RAM). Let’s take your Library example there are several books related to different categories and sub categories are organised on some parameter let’s say it’s based on author names. Here is easy to pick a book when you gone through them.

Now, just think that library is not organised it is like heap all over, now it’s difficult for us to find a book. It might take hours or days to find the book you are looking for.

So, same way it is difficult to computers too, so in order to make ease of the process of solving complex problems we use the structure the information. To do that we have a fashioned way to solve the problem more efficiently. It is by using the data structure.

Yes, we can implement by using Java code and also C/C++. Because of full object oriented programming(OOPs) we can capable to solve the problem with less line of code with better efficiency in using memory. OOPs is good because data structures are

Because it is dynamic in storing the data in memory and using it efficiently in search and storing it.

I think Binary tree is best to use, because of child and parent nodes. So we can inherit some features using inheritance technique of OOPs concept.