SlideShare a Scribd company logo
1 of 4
public class ThreeTenDLList<T> implements Iterable<T> {
// doubly linked list with both head and tail, no dummy nodes
private Node<T> head; //beginning of list
private Node<T> tail; //end of list
// ADD MORE PRIVATE MEMBERS HERE IF NEEDED!
//constructor
// initialize the list to being an empty list
public ThreeTenDLList(){
}
// report number of items
// O(1)
public int size(){
//default return, remove or updated as needed
return -1;
}
// returns the first value from the beginning of the list
// do not remove the value!
// return null if list is empty
// O(1)
public T getFirst() {
//default return, remove or updated as needed
return null;
}
// inserts a new node with value at the begining of the list
// you can assume value is not null
// O(1)
public void addFirst(T value) {
}
// remove and return the first value in the list
//return null if list is empty
// O(1)
public T removeFirst(){
//default return, remove or updated as needed
return null;
}
// returns the last value from the end of the list
// do not remove the value!
// return null if list is empty
// O(1)
public T getLast() {
//default return, remove or updated as needed
return null;
}
// inserts a new value at the end of the list
// you can assume value is not null
// O(1)
public void addLast(T value) {
}
// remove and return the last value from the end of the list
//return null if list is empty
// O(1)
public T removeLast(){
//default return, remove or updated as needed
return null;
}
//remove and return the first occurence of value
// (i.e. the occurence that is closest to head)
// - return null if value is not present
// - note: must return the data from list, not the argument value
//O(n) where n is the number of items
public T remove(T value){
//default return, remove or updated as needed
return null;
}
// return a string representing the values in the list starting from index to end,
// seperated by a single space
// return empty string for invalid start or empty list
// O(n) where n is the number of items
// Warning: concatenating String objects will yield a O(n^2) solution
public String listToString(int start) {
//default return, remove or updated as needed
return null;
}
// return a string representing the values in the list, from end to beginning,
// seperated by a single space
// return empty string for an empty list
// O(n) where n is the number of items
// Warning: concatenating String objects will yield a O(n^2) solution
public String listToStringBackward() {
//default return, remove or updated as needed
return null;
}
public Iterator<T> iterator() {
//Return an iterator that traverses from
//the beginning (head) to the end (tail) of the list
//The iterator's hasNext() and next() methods
//must both be O(1)
//next() should throw a NullPointerException
//if you try to use next when there are no
//more items (any error message is fine).
//update / replace this dummy return statement as needed
return null;
}
public Iterator<T> backwardIterator() {
//Return an iterator that traverses from
//the end (tail) to the beginning (head) of the list
//The iterator's hasNext() and next() methods
//must both be O(1)
//next() should throw a NullPointerException
//if you try to use next when there are no
//more items (any error message is fine).
//update / replace this dummy return statement as needed
return null;
}

More Related Content

Similar to public class ThreeTenDLList-T- implements Iterable-T- { -- doubly.docx

The LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdfThe LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdf
malavshah9013
 
Data Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdfData Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdf
rohit219406
 
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfImplement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
rishabjain5053
 
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdfNeed Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Edwardw5nSlaterl
 
STAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdfSTAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdf
babitasingh698417
 
This will need to be in a header file called LinkedList.hInser.pdf
This will need to be in a header file called LinkedList.hInser.pdfThis will need to be in a header file called LinkedList.hInser.pdf
This will need to be in a header file called LinkedList.hInser.pdf
cleanhome88
 
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdfC++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
callawaycorb73779
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
EricvtJFraserr
 
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
AdrianEBJKingr
 
Implementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfImplementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdf
maheshkumar12354
 
Jhtp5 20 Datastructures
Jhtp5 20 DatastructuresJhtp5 20 Datastructures
Jhtp5 20 Datastructures
martha leon
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
accostinternational
 
here is the starter code public class LinkedListPracticeLab.pdf
here is the starter code public class LinkedListPracticeLab.pdfhere is the starter code public class LinkedListPracticeLab.pdf
here is the starter code public class LinkedListPracticeLab.pdf
geetakannupillai1
 

Similar to public class ThreeTenDLList-T- implements Iterable-T- { -- doubly.docx (20)

The LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdfThe LinkedList1 class implements a Linked list. class.pdf
The LinkedList1 class implements a Linked list. class.pdf
 
Data Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdfData Structures in C++I am really new to C++, so links are really .pdf
Data Structures in C++I am really new to C++, so links are really .pdf
 
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdfImplement the interface you wrote for Lab B (EntryWayListInterface)..pdf
Implement the interface you wrote for Lab B (EntryWayListInterface)..pdf
 
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdfNeed Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
 
STAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdfSTAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdf
 
This will need to be in a header file called LinkedList.hInser.pdf
This will need to be in a header file called LinkedList.hInser.pdfThis will need to be in a header file called LinkedList.hInser.pdf
This will need to be in a header file called LinkedList.hInser.pdf
 
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdfC++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
 
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
--INSTRUCTION- --It helps to first create if-then-else structure to fi.pdf
 
Implementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdfImplementation The starter code includes List.java. You should not c.pdf
Implementation The starter code includes List.java. You should not c.pdf
 
Jhtp5 20 Datastructures
Jhtp5 20 DatastructuresJhtp5 20 Datastructures
Jhtp5 20 Datastructures
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
 
here is the starter code public class LinkedListPracticeLab.pdf
here is the starter code public class LinkedListPracticeLab.pdfhere is the starter code public class LinkedListPracticeLab.pdf
here is the starter code public class LinkedListPracticeLab.pdf
 
Lec-4_Linked-List (1).pdf
Lec-4_Linked-List (1).pdfLec-4_Linked-List (1).pdf
Lec-4_Linked-List (1).pdf
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 

More from LukeQVdGrantg

Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docxProlessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
LukeQVdGrantg
 

More from LukeQVdGrantg (20)

Provide examples of the -monkey- attempting to be transferred from a s.docx
Provide examples of the -monkey- attempting to be transferred from a s.docxProvide examples of the -monkey- attempting to be transferred from a s.docx
Provide examples of the -monkey- attempting to be transferred from a s.docx
 
Provide 3 substantive audit procedures chosen among the following topi.docx
Provide 3 substantive audit procedures chosen among the following topi.docxProvide 3 substantive audit procedures chosen among the following topi.docx
Provide 3 substantive audit procedures chosen among the following topi.docx
 
Provide an appropriate response- Determine the probability distributio.docx
Provide an appropriate response- Determine the probability distributio.docxProvide an appropriate response- Determine the probability distributio.docx
Provide an appropriate response- Determine the probability distributio.docx
 
Punnett square problems continued Complete the following problems- Lis.docx
Punnett square problems continued Complete the following problems- Lis.docxPunnett square problems continued Complete the following problems- Lis.docx
Punnett square problems continued Complete the following problems- Lis.docx
 
Public - Week 12- Interactive activity 12-1 Learning Outcomes- Discuss.docx
Public - Week 12- Interactive activity 12-1 Learning Outcomes- Discuss.docxPublic - Week 12- Interactive activity 12-1 Learning Outcomes- Discuss.docx
Public - Week 12- Interactive activity 12-1 Learning Outcomes- Discuss.docx
 
public class Bitset implements Set{ private boolean set--- pub.docx
public class Bitset implements Set{     private boolean set---     pub.docxpublic class Bitset implements Set{     private boolean set---     pub.docx
public class Bitset implements Set{ private boolean set--- pub.docx
 
Protecting the Business 14- Briefly describe any business insurance yo.docx
Protecting the Business 14- Briefly describe any business insurance yo.docxProtecting the Business 14- Briefly describe any business insurance yo.docx
Protecting the Business 14- Briefly describe any business insurance yo.docx
 
ProShares UltraPro QQQ has a total asset turnover of 1-29- a debt-equi.docx
ProShares UltraPro QQQ has a total asset turnover of 1-29- a debt-equi.docxProShares UltraPro QQQ has a total asset turnover of 1-29- a debt-equi.docx
ProShares UltraPro QQQ has a total asset turnover of 1-29- a debt-equi.docx
 
Properties that Define Life ( 10 points) Matching- Please write the le.docx
Properties that Define Life ( 10 points) Matching- Please write the le.docxProperties that Define Life ( 10 points) Matching- Please write the le.docx
Properties that Define Life ( 10 points) Matching- Please write the le.docx
 
Prompt 3- 70- of the light aircraft that disappear while in flight in.docx
Prompt 3- 70- of the light aircraft that disappear while in flight in.docxPrompt 3- 70- of the light aircraft that disappear while in flight in.docx
Prompt 3- 70- of the light aircraft that disappear while in flight in.docx
 
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docxPrompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
Prompt- (Part 1) Is life in the metaverse inevitable or unlikely- Are.docx
 
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docxProkaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
Prokaryotes are all gram positive- eukaryotes are all gram negative Pr.docx
 
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docxProlessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
Prolessor fsadore (Lmy) Invest-a-Lot retired two years ago from Except.docx
 
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docxPROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
PROLOG Convert this proposition to Object-Attribute-Value proposition(.docx
 
Project Part 1- Analysis of the opportunities and risks of a company i.docx
Project Part 1- Analysis of the opportunities and risks of a company i.docxProject Part 1- Analysis of the opportunities and risks of a company i.docx
Project Part 1- Analysis of the opportunities and risks of a company i.docx
 
Project Objectives- To write a program that implements the following A.docx
Project Objectives- To write a program that implements the following A.docxProject Objectives- To write a program that implements the following A.docx
Project Objectives- To write a program that implements the following A.docx
 
Project gamesmanship in organizations performs what purpose- Creates c.docx
Project gamesmanship in organizations performs what purpose- Creates c.docxProject gamesmanship in organizations performs what purpose- Creates c.docx
Project gamesmanship in organizations performs what purpose- Creates c.docx
 
Project managers should turn customer needs into requirements- The sum.docx
Project managers should turn customer needs into requirements- The sum.docxProject managers should turn customer needs into requirements- The sum.docx
Project managers should turn customer needs into requirements- The sum.docx
 
Project managers use this conflict resolution technique most often- A-.docx
Project managers use this conflict resolution technique most often- A-.docxProject managers use this conflict resolution technique most often- A-.docx
Project managers use this conflict resolution technique most often- A-.docx
 
Project Controlling involves ensuring that performance does not deviat.docx
Project Controlling involves ensuring that performance does not deviat.docxProject Controlling involves ensuring that performance does not deviat.docx
Project Controlling involves ensuring that performance does not deviat.docx
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdfRich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 

public class ThreeTenDLList-T- implements Iterable-T- { -- doubly.docx

  • 1. public class ThreeTenDLList<T> implements Iterable<T> { // doubly linked list with both head and tail, no dummy nodes private Node<T> head; //beginning of list private Node<T> tail; //end of list // ADD MORE PRIVATE MEMBERS HERE IF NEEDED! //constructor // initialize the list to being an empty list public ThreeTenDLList(){ } // report number of items // O(1) public int size(){ //default return, remove or updated as needed return -1; } // returns the first value from the beginning of the list // do not remove the value! // return null if list is empty // O(1) public T getFirst() { //default return, remove or updated as needed return null; } // inserts a new node with value at the begining of the list // you can assume value is not null // O(1) public void addFirst(T value) { } // remove and return the first value in the list //return null if list is empty // O(1) public T removeFirst(){ //default return, remove or updated as needed return null; }
  • 2. // returns the last value from the end of the list // do not remove the value! // return null if list is empty // O(1) public T getLast() { //default return, remove or updated as needed return null; } // inserts a new value at the end of the list // you can assume value is not null // O(1) public void addLast(T value) { } // remove and return the last value from the end of the list //return null if list is empty // O(1) public T removeLast(){ //default return, remove or updated as needed return null; } //remove and return the first occurence of value // (i.e. the occurence that is closest to head) // - return null if value is not present // - note: must return the data from list, not the argument value //O(n) where n is the number of items public T remove(T value){ //default return, remove or updated as needed return null; } // return a string representing the values in the list starting from index to end, // seperated by a single space // return empty string for invalid start or empty list // O(n) where n is the number of items // Warning: concatenating String objects will yield a O(n^2) solution public String listToString(int start) {
  • 3. //default return, remove or updated as needed return null; } // return a string representing the values in the list, from end to beginning, // seperated by a single space // return empty string for an empty list // O(n) where n is the number of items // Warning: concatenating String objects will yield a O(n^2) solution public String listToStringBackward() { //default return, remove or updated as needed return null; } public Iterator<T> iterator() { //Return an iterator that traverses from //the beginning (head) to the end (tail) of the list //The iterator's hasNext() and next() methods //must both be O(1) //next() should throw a NullPointerException //if you try to use next when there are no //more items (any error message is fine). //update / replace this dummy return statement as needed return null; } public Iterator<T> backwardIterator() { //Return an iterator that traverses from //the end (tail) to the beginning (head) of the list //The iterator's hasNext() and next() methods //must both be O(1) //next() should throw a NullPointerException //if you try to use next when there are no //more items (any error message is fine). //update / replace this dummy return statement as needed return null;
  • 4. }