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

Implement a city database using unordered lists. Each database record contains t

ID: 3692333 • Letter: I

Question

Implement a city database using unordered lists. Each database record contains the name of the city (a string of arbitrary length) and the coordinates of the city expressed as integer x and y coordinates. Your database should allow records to be inserted, deleted by name or coordinate, and searched by name or coordinate. Another operation that should be supported is to print all records within a given distance of a specified point. Implement the database using an array-based list implementation, and then a linked list implementation. Collect running time statistics for each operation in both implementations. What are your conclusions about the relative advantages and disadvantages of the two implementations? Would storing records on the list in alphabetical order by city name speed any of the operations? Would keeping the list in alphabetical order slow any of the operations?

Explanation / Answer

Advantages of Array Implementation :

1. Random accessof record is possible

2. Easy to implement.

Disadvantage of Arrat Implementaion :

1. Insertion and Deletion of record is not easy.

2. Size of Array needs to be predefined and fixed.

Linked List Implementaion:

Advantages:

1. Memory is allocated dynamically so It is not fixed.

2.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote