Need help with this. Thank you in advances. Comments in the code are appreciated for learning….

Need help with this. Thank you in advances. Comments in the code are appreciated for learning.

You need to write an efficient Linked-List class. You will use this class to construct your Stack and Queue in Java

YOU CANNOT USE ANY BUILT IN LIBRARIES OR YOU WILL GET A ZERO

Your class must be O(1) in all cases. So, you must maintain a reference (link) to the tail. For the class, you will need an internal node class. Use the following definition. Notice that it will be defined using “object” – this will work for all data types.

YOU Need to HAVE class node in your linked List as an internal class

class Node

public Object Value

public Node Next

end class

The following is the required interface for class. This is not a deque, but it has many of the same features. It is a singly-linked list.

public class LinkedList

string About() Returns text about you – the author of this class.

void AddHead(Object item) Adds an object to the head of the list. This must be O(1).

void AddTail(Object item) Adds an object to the tail of the list. This must be O(1).

object RemoveHead() Removed an object from the head of the list. This must be O(1).

object PeekHead() Returns the value from the head of the list. It returns the value, not the node itself. This must be O(1).

2. Then you need to create a Stack using your LINKED LIST

YOU CANNOT USE ANY BUILT IN LIBRARIES OR YOU WILL GET A ZERO

it wraps around your Linked-List class. Don’t inherit. The objects from the Linked-List will be cast to doubles

public class Stack

string

About()

Returns text about you – the author of this class.

void

Push(double item)

Pushes a double (number) onto the stack.

double

Pop()

Pops (removes) an item from the top of the stack.

double

Peek()

Returns the value on the top of the stack. Do not return the node itself.

boolean

IsEmpty()

Returns true of the stack is empty.

The Queue Class

The following is the interface for the Queue Class. This will be fairly easy to write – since it wraps around your Linked-List class. Don’t inherit. The objects from the Linked-List will be cast to strings. NO BUILT IN LIBRARY

public class Queue

string

About()

Returns text about you – the author of this class.

void

Enqueue(string item)

Enqueues a string onto the queue.

string

Dequeue()

Dequeues (removes) a string from the front of the queue.

string

Peek()

Returns the value on the front of the queue. Do not return the node itself.

boolean

IsEmpty()

Returns true of the stack is empty.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!