Question: 1. Write a declaration of an ArrayBoundedStack named s that has a capacity of 100 and holds String objects. Do not use StackInterface in your
1. Write a declaration of an ArrayBoundedStack named s that has a capacity of 100 and holds String objects. Do not use StackInterface in your declaration.
2. Recall that within the LinkedQueue the front and rear variables are of type LLNode
public boolean isFull()
// Returns true if this queue is full, otherwise returns false.
{
// complete the method body
}
3. Show the contents of the queue, from front to back, after the execution of the following segment of code, given that queue is an object that fits an abstract description of a queue (originally empty). Assume that you can store and retrieve variables of type int on queue. (Note: also discuss your work in terms of how you got your answer.)
queue.enqueue(15); queue.dequeue(); queue.enqueue(0); queue.enqueue(20);
queue.dequeue(); queue.enqueue(10);
queue.enqueue(queue.dequeue());
for (int i = 1; i <= 3; i++)
queue.enqueue (i + 3);
queue.dequeue();
4. Recall that within the LinkedCollection the numElements variable holds the number of elements currently in the collection, and the head variable of type LLNode
public boolean add(T element)
// Adds element to this collection.
{
// complete the method body
}
5. Recall that within the LinkedCollection the head variable of type LLNode
public T get(T target)
// Returns an element e from this collection such that e.equals(target);
// if no such element exists, returns null.
{
// complete the method body
}
COURSE- DATA STRUCTURES JAVA
PLEASE HELP ASAP. THANKS IN ADVANCE.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
