Develop Java classes for each of the following objects
$20-25 USD
Завершено
Опублікований about 22 years ago
$20-25 USD
Оплачується при отриманні
Develop Java classes for each of the following objects: 1. A generic element class named elt; abstract class, no data members and no member functions. 2. A child class of the class elt named comp_elt; abstract class, no data members and 1 abstract member function named compare. The compare function is to be called as [login to view URL](y) where both x and y are instances of comp_elt; compare returns -1 if x < y; 0 if x = y; 1 if x > y. 3. A generic stack class named my_stack; concrete class, each instance has a data member which is an array of references to instances of class elt. Another data member named count is an int which keeps track of the number of active elt refs in the given instance of my_stack. Two more int data members named max and grow_by keep track of the current size of the array and the amount it should grow by if it fills up at the current size. member functions: default constructor sets max to 50 and grow_by to 0. a second constructor allows user to set both the initial size of the array and the grow_by amount as parameters. The first parameter sets the size to 50 and the second to 10. a member function named push takes an elt ref as its only parameter and inserts that elt ref into the stack as the Last-in member of the stack. a member function named pop removes the Last-in ref and returns that ref to the user. a member function size returns the number of active elt refs in the current stack. a member function empty returns true if the stack is empty, false otherwise. 4. A generic queue class named my_queue;concrete class, each instance has a data member which is an array of references to instances of class elt. Two more data members named front and back are ints and keep track of the indices of the front and back elt refs in the given instance of my_stack. Two more int data members named max and grow_by keep track of the current size of the array and the amount member functions: default constructor sets max to 50 and grow_by to 0. a second constructor allows user to set both the initial size of the array and the grow_by amount as parameters. insert: takes a single comp_elt ref and inserts that ret into the heap. remove: removes the root from the heap and returns the appropriate ref. size: returns number of active comp_elt refs in the heap. bubbleup(private): restores the power relationship in the heap during inseret. bubbledown(private): restores the power relationship in the heap during a remove.
## Deliverables
Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Program must be fully comment. Complete copyrights to all work purchased. DUE March 19, 2002. 7:00PM Eastern Time. *** PLEASE SEE ATTACHMENT FILE FOR DETAIL OUTLINE! ***
## Platform
Must be able to compile and execute on Java (JDK 1.1) DUE March 19, 2002. 7:00PM Eastern Time. *** PLEASE SEE ATTACHMENT FILE FOR DETAIL OUTLINE! ***
## Deadline information
DUE March 19, 2002. 7:00PM Eastern Time. *** PLEASE SEE ATTACHMENT FILE FOR DETAIL OUTLINE! ***