Question: import java.util.Iterator; public class customDSLL implements Iterable { private Node front; private Node back; private class Node{ /* * TO DO * Inner class */

import java.util.Iterator;

public class customDSLL implements Iterable{

private Node front;

private Node back;

private class Node{

/*

* TO DO

* Inner class

*/

}

public boolean isEmpty() {

/*

* TO DO

* return true if the DS is empty, else return false

*/

return true;

}

public int size() {

/*

* TO DO

* return the size of the DS, i.e the number of elements in the DS. Can you do it in constant time?

*/

return 0;

}

public void insertFront(Item it) {

/*

* TO DO

* Insert a new element at the front pointer.

*/

}

public void insertBack(Item it) {

/*

* TO DO

* Insert a new element at the back pointer.

*/

}

public Item removeFront() {

/*

* TO DO

* Remove a new element from the front pointer.

*/

return null;

}

public Item removeBack() {

/*

* TO DO

* Remove a new element from the back pointer.

*/

return null;

}

public Iterator iterator() {

/*

* TO DO

* Implement the iterator to enable usage of "foreach" loop.

*/

return null;

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!