Fall 2013-2014
CEN231 - Data Structures and Algorithms
Assignment -1
Deadline: Thursday - 5pm, January 2, 2014.
1-) STACK
Create a stack data structure using Array/ArrayList/Linked list implementation. Your stack class should
contain the following basic functions
boolean isEmpty() { ... }
public void push(T element) { ... }
public void pop() { ... }
public T peek() { ... }
Create a class called "city". The class has private data members name (string), x-coordinate (double) and
y-coordinate (double). Provide a constructor that enables an object of this class to be initialized when it
is declared. The constructor should take the name and x and y coordinates of the city as input. Add the
following public member functions to your class that
A. Finds the the city's distance any other city. Input of your function should be the name of the
other city.
B. Finds the furthest city to any city given by its name.
In your main function create 5 cities each with name and x and y coordinates. Push each city onto the
stack.
Test each of these functions in your main function in at least 3 examples by popping the cities from the
stack.
2-) QUEUE
Create a queue data structure using Array/Linked list implementation. Your queue class should contain
the following basic functions
public boolean isEmpty() { ... }
public boolean isFull() { ... }
public void enqueue(Telement) { ... }
public void dequeue() { ... }
1Create a class called "customer". The class has private data members name (string), surname (string),
hour (integer) and minute (integer) for the arrival time to the bank, service-id (integer) for the service
the customer wants to get. service-id will be ranged between 1-5. The higher the service-id is the more
amount of time it takes for the service to be finished. Provide a constructor that enables an object of
this class to be initialized when it is declared. The constructor should take the name, surname, hour,
minute and service-id. Add a public function calculate-service-time which calculates the service time by
multiplying the service-id by 5.
In your main function create 5 customers each with name, surname, arrival time (hour and minute) and
service-id. The information of each customer will be read from screen. Consider that the arrival time
information may not be given in order. Insert (Enqueue) each customer to the queue according to the
arrival time. Note that you should place the customer to the correct place in the queue. The earliest
arrival time should always be at the front of the queue. Then dequeue each customer and print the
service-time for each customer by calling calculate-service-time function.
hi this is Asad, i have a lot of experience with java programming and datastructures,it is just a piece of cake for me, hire me wont disappoint you,cheers :D
$10 USD en 2 días
0,0 (1 comentario)
0,0
0,0
6 freelancers están ofertando un promedio de $59 USD por este trabajo
Greetings! I'm willing to work on your project . i hope you can see that I'm reliable for java assignments. So there shouldn't be no problem . Thanks. I'm waiting for your reply.
Hello onuracar,
I'm Asem Athwari, Data Starucuctures Teacher.
I'm teaching data structures using Java in Taiz University, I have the code you looking for, and I'm ready to modify it to follow your assignment requirements.
I have also codes for Linked List, Tree and graphs. I can help you in future if you like too.
Best regards, Clinux.
Hello Sir,
We have gone through the details you have provided, we can deliver as u have mentioned and would be pleased to work on this with you to deliver the results that you have expected and can deliver as u have mentioned We are sure you will not be disappointed if you give us this opportunity. We have an impeccable record and all our clients enjoy working with us, we are sure that you will too,