Implement a city database using ordered lists by using java. 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, and searched by name. Another operation  that should be supported is to print all records within a given distance of a specified point/coordinate.  The order of cities should be alphabetically by city name. Implement the database using both: an arraybased list implementation, and a circular single linked list implementation. Use may the following node, SLL implementations to implement an ordered circular single linked list

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Implement a city database using ordered lists by using java. 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, and searched by name. Another operation 
that should be supported is to print all records within a given distance of a specified point/coordinate. 
The order of cities should be alphabetically by city name. Implement the database using both: an arraybased list implementation, and a circular single linked list implementation.
Use may the following node, SLL implementations to implement an ordered circular single linked list

Implement a city database using ordered 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, and searched by name. Another operation
that should be supported is to print all records within a given distance of a specified point/coordinate.
The order of cities should be alphabetically by city name. Implement the database using both: an array-
based list implementation, and a circular single linked list implementation.
Use may the following node, SLL implementations to implement an ordered circular single linked list
/** Single linked list node */ public
class SLNode<E>
{
private E info;
private SLNode<E> next;
Constructors */
public SLNode (E it, SLNode<E> n)
{
info = it;
next n;
}
public
{
}
}
SLNode ()
next = null;
/** Get and set methods for the data members */
public SLNode<E> next()
{ return next; }
public void setNext (SLNode<E> nextval)
{ next nextval; }
public E info()
{ return info; }
public void setInfo (E it)
{ info it; }
// Value for this node
// Pointer to next node in list
/**
public class SLL<E> {
// Instance variables
private SLNode<E> head;
// Provide your methods here.
Transcribed Image Text:Implement a city database using ordered 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, and searched by name. Another operation that should be supported is to print all records within a given distance of a specified point/coordinate. The order of cities should be alphabetically by city name. Implement the database using both: an array- based list implementation, and a circular single linked list implementation. Use may the following node, SLL implementations to implement an ordered circular single linked list /** Single linked list node */ public class SLNode<E> { private E info; private SLNode<E> next; Constructors */ public SLNode (E it, SLNode<E> n) { info = it; next n; } public { } } SLNode () next = null; /** Get and set methods for the data members */ public SLNode<E> next() { return next; } public void setNext (SLNode<E> nextval) { next nextval; } public E info() { return info; } public void setInfo (E it) { info it; } // Value for this node // Pointer to next node in list /** public class SLL<E> { // Instance variables private SLNode<E> head; // Provide your methods here.
A
lat
B
1
city
2
Tokyo
3 Jakarta
4 Delhi
5
Manila
6 São Paul
-23.5504
7 Seoul
37.56
126.99
8 Mumbai
19.0758 72.8775
9
Shanghai
31.1667 121.4667
10 Mexico Cit 19.4333 -99.1333
11 Guangzho
23.1288
113.259
12 Cairo
30.0444 31.2358
13 Beijing
39.904 116.4075
14 New York
40.6943
-73.9249
15 KolkÄta
22.5727
88.3639
16 Moscow
55.7558
37.6178
17 Bangkok
13.75
100.5167
18 Dhaka
23.7289
90.3944
19 Buenos Ai -34.5997 -58.3819
20 Lagos
6.45
3.4
с
Ing
35.6839
139.7744
-6.2146 106.8451
28.6667 77.2167
14.6 120.9833
-46.6339
Transcribed Image Text:A lat B 1 city 2 Tokyo 3 Jakarta 4 Delhi 5 Manila 6 São Paul -23.5504 7 Seoul 37.56 126.99 8 Mumbai 19.0758 72.8775 9 Shanghai 31.1667 121.4667 10 Mexico Cit 19.4333 -99.1333 11 Guangzho 23.1288 113.259 12 Cairo 30.0444 31.2358 13 Beijing 39.904 116.4075 14 New York 40.6943 -73.9249 15 KolkÄta 22.5727 88.3639 16 Moscow 55.7558 37.6178 17 Bangkok 13.75 100.5167 18 Dhaka 23.7289 90.3944 19 Buenos Ai -34.5997 -58.3819 20 Lagos 6.45 3.4 с Ing 35.6839 139.7744 -6.2146 106.8451 28.6667 77.2167 14.6 120.9833 -46.6339
Expert Solution
steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education