Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

a) In this document/report, you need to describe and justify your selection of

data structure implemented. You may implement different data structures for
each component (i.e. Book and Patron).

Java uses data structures to store and organise data so that it can be used more
effectively. Data structures come in two varieties: non-primitive data structures and
primitive data structures. A data structure that simply stores one kind of data is referred
to as a "primitive data structure." A data structure is not only used for organizing the
data. It is also used for processing, retrieving, and storing data. There are different
basic and advanced types of data structures that are used in almost every program or
software system that has been developed.

In this assignment, I used structure stack, linked list to complete this program. I used
same data structure for both (Patron and Book). A stack can also be implemented
using arrays. But arrays are of limited size, and the size of the stack must be
predetermined, whereas, in a linked list, implementation nodes can be added
according to the user's requirements. A linked list is a linear data structure, in which
the elements are not stored at contiguous memory locations.

Implemented stack in linked list:

Add element in linked list for Book:


Add element in linked list for Patron:

b) Visualize your chosen data structures for both Book and Patron with sample data.
c) Provide the flowchart for the following operations:
i) Flowchart – Add book Start

Admin Password
No

Yes

Add Book

Enter Book Title

Enter Book Availability

Enter Book Category

Enter Book Genre

No
Enter all data Wait

Yes

Do you want to do Yes


another admin
operation?

No

End
ii) Flowchart – Search book
Start

Menu

Search Book

No Yes
Enter Display Books Detail
Category

No Yes
End Enter Title Display Books Detail

No Yes
Enter
Genre Display Books Detail

No Do you want to do Yes


another admin
operation?
iii) Flowchart – Display 10 Book

Start

Menu

Display 10 book
borrowed by Patron

Yes
No
Enter Title Display Patron’s List

End

No Enter last Yes


10 books Display Detail 10
borrowed books borrowed by a
by a Patron Patron

No Do you want to do Yes


another admin
operation?

iii) Flowchart – Update Patron Information


Start

Register

Sign In

Update Account

Update Name

Update Telephone
Number

Do you want to do Yes


another user
operation?

No

End

You might also like