SlideShare a Scribd company logo
Please find my implementation:
public KeyedItem remove()
{
//DO THIS
//remove the smallest item
// since Linked List is in sorted order, so head is the samllest element
if(head == null)
return null;
// return head element and move head one step forward
KeyedItem item = head.getItem();
head = head.getNext();
return item;
}
private Node locateNodeAdd(KeyedItem item)
{
//DO THIS
//find the insertion location (remember FIFO for duplicates)
Node curr = head;
Node prev = null;
while(curr != null){
if((current.getItem().getKey()).compareTo(item.getKey) >= 0){
return prev;
}
prev = curr;
curr = curr.getNext();
}
return prev;
}
Solution
Please find my implementation:
public KeyedItem remove()
{
//DO THIS
//remove the smallest item
// since Linked List is in sorted order, so head is the samllest element
if(head == null)
return null;
// return head element and move head one step forward
KeyedItem item = head.getItem();
head = head.getNext();
return item;
}
private Node locateNodeAdd(KeyedItem item)
{
//DO THIS
//find the insertion location (remember FIFO for duplicates)
Node curr = head;
Node prev = null;
while(curr != null){
if((current.getItem().getKey()).compareTo(item.getKey) >= 0){
return prev;
}
prev = curr;
curr = curr.getNext();
}
return prev;
}

More Related Content

Similar to Please find my implementationpublic KeyedItem remove() { DO.pdf

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
 
Given below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfGiven below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdf
info430661
 
Program to insert in a sorted list #includestdio.h#include.pdf
 Program to insert in a sorted list #includestdio.h#include.pdf Program to insert in a sorted list #includestdio.h#include.pdf
Program to insert in a sorted list #includestdio.h#include.pdf
sudhirchourasia86
 
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
rambagra74
 
Implement the additional 5 methods as indicated in the LinkedList fi.pdf
Implement the additional 5 methods as indicated in the LinkedList fi.pdfImplement the additional 5 methods as indicated in the LinkedList fi.pdf
Implement the additional 5 methods as indicated in the LinkedList fi.pdf
footstatus
 
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdf
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdfHere is the editable codeSolutionimport java.util.NoSuchEleme.pdf
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdf
arrowmobile
 
1) Create a function called reverselist that will take a simple list.pdf
1) Create a function called reverselist that will take a simple list.pdf1) Create a function called reverselist that will take a simple list.pdf
1) Create a function called reverselist that will take a simple list.pdf
ivylinvaydak64229
 
Write the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdfWrite the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdf
fckindswear
 
Linked lists
Linked listsLinked lists
Linked lists
George Scott IV
 
implement the ListLinked ADT (the declaration is given in ListLinked.pdf
implement the ListLinked ADT (the declaration is given in ListLinked.pdfimplement the ListLinked ADT (the declaration is given in ListLinked.pdf
implement the ListLinked ADT (the declaration is given in ListLinked.pdf
FOREVERPRODUCTCHD
 
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdfAssignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Footageetoffe16
 
How to do the main method for this programBinaryNode.javapublic.pdf
How to do the main method for this programBinaryNode.javapublic.pdfHow to do the main method for this programBinaryNode.javapublic.pdf
How to do the main method for this programBinaryNode.javapublic.pdf
feelingcomputors
 
JAVA A double-ended queue is a list that allows the addition and.pdf
JAVA A double-ended queue is a list that allows the addition and.pdfJAVA A double-ended queue is a list that allows the addition and.pdf
JAVA A double-ended queue is a list that allows the addition and.pdf
amrishinda
 
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdfDesign, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
trishacolsyn25353
 
Implement the following specification of UnsortedType using circular.pdf
Implement the following specification of UnsortedType using circular.pdfImplement the following specification of UnsortedType using circular.pdf
Implement the following specification of UnsortedType using circular.pdf
udit652068
 
Help please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdfHelp please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdf
jyothimuppasani1
 
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
petercoiffeur18
 
Javascript tid-bits
Javascript tid-bitsJavascript tid-bits
Javascript tid-bits
David Atchley
 

Similar to Please find my implementationpublic KeyedItem remove() { DO.pdf (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
 
Given below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfGiven below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdf
 
Program to insert in a sorted list #includestdio.h#include.pdf
 Program to insert in a sorted list #includestdio.h#include.pdf Program to insert in a sorted list #includestdio.h#include.pdf
Program to insert in a sorted list #includestdio.h#include.pdf
 
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
 
Implement the additional 5 methods as indicated in the LinkedList fi.pdf
Implement the additional 5 methods as indicated in the LinkedList fi.pdfImplement the additional 5 methods as indicated in the LinkedList fi.pdf
Implement the additional 5 methods as indicated in the LinkedList fi.pdf
 
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdf
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdfHere is the editable codeSolutionimport java.util.NoSuchEleme.pdf
Here is the editable codeSolutionimport java.util.NoSuchEleme.pdf
 
1) Create a function called reverselist that will take a simple list.pdf
1) Create a function called reverselist that will take a simple list.pdf1) Create a function called reverselist that will take a simple list.pdf
1) Create a function called reverselist that will take a simple list.pdf
 
Write the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdfWrite the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdf
 
Linked lists
Linked listsLinked lists
Linked lists
 
implement the ListLinked ADT (the declaration is given in ListLinked.pdf
implement the ListLinked ADT (the declaration is given in ListLinked.pdfimplement the ListLinked ADT (the declaration is given in ListLinked.pdf
implement the ListLinked ADT (the declaration is given in ListLinked.pdf
 
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdfAssignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
 
How to do the main method for this programBinaryNode.javapublic.pdf
How to do the main method for this programBinaryNode.javapublic.pdfHow to do the main method for this programBinaryNode.javapublic.pdf
How to do the main method for this programBinaryNode.javapublic.pdf
 
JAVA A double-ended queue is a list that allows the addition and.pdf
JAVA A double-ended queue is a list that allows the addition and.pdfJAVA A double-ended queue is a list that allows the addition and.pdf
JAVA A double-ended queue is a list that allows the addition and.pdf
 
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdfDesign, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
Design, implement, test(In Java ) a doubly linked list ADT, using DL.pdf
 
JS OO and Closures
JS OO and ClosuresJS OO and Closures
JS OO and Closures
 
Implement the following specification of UnsortedType using circular.pdf
Implement the following specification of UnsortedType using circular.pdfImplement the following specification of UnsortedType using circular.pdf
Implement the following specification of UnsortedType using circular.pdf
 
Help please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdfHelp please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdf
 
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
 
CSE240 Doubly Linked Lists
CSE240 Doubly Linked ListsCSE240 Doubly Linked Lists
CSE240 Doubly Linked Lists
 
Javascript tid-bits
Javascript tid-bitsJavascript tid-bits
Javascript tid-bits
 

More from anjaliselectionahd

10. The push button is pushed to the second stop when we pipette out.pdf
10. The push button is pushed to the second stop when we pipette out.pdf10. The push button is pushed to the second stop when we pipette out.pdf
10. The push button is pushed to the second stop when we pipette out.pdf
anjaliselectionahd
 
1. Working capital is the capital that a company uses for its day to.pdf
1. Working capital is the capital that a company uses for its day to.pdf1. Working capital is the capital that a company uses for its day to.pdf
1. Working capital is the capital that a company uses for its day to.pdf
anjaliselectionahd
 
1. no2.The Waterfall model has some disadvantages.Agile software.pdf
1. no2.The Waterfall model has some disadvantages.Agile software.pdf1. no2.The Waterfall model has some disadvantages.Agile software.pdf
1. no2.The Waterfall model has some disadvantages.Agile software.pdf
anjaliselectionahd
 
True ; this is known as Tyndal effect .pdf
                     True  ; this is known as Tyndal effect           .pdf                     True  ; this is known as Tyndal effect           .pdf
True ; this is known as Tyndal effect .pdf
anjaliselectionahd
 
TLC is used to separate the compounds.the benzoic.pdf
                     TLC is used to separate the compounds.the benzoic.pdf                     TLC is used to separate the compounds.the benzoic.pdf
TLC is used to separate the compounds.the benzoic.pdf
anjaliselectionahd
 
The answer to this question is (E) If you look at.pdf
                     The answer to this question is (E) If you look at.pdf                     The answer to this question is (E) If you look at.pdf
The answer to this question is (E) If you look at.pdf
anjaliselectionahd
 
sp hybridized orbital Solution .pdf
                     sp hybridized orbital  Solution              .pdf                     sp hybridized orbital  Solution              .pdf
sp hybridized orbital Solution .pdf
anjaliselectionahd
 
SO2(g) + H2O(l) - H2SO4(aq) .pdf
                     SO2(g) + H2O(l) - H2SO4(aq)                     .pdf                     SO2(g) + H2O(l) - H2SO4(aq)                     .pdf
SO2(g) + H2O(l) - H2SO4(aq) .pdf
anjaliselectionahd
 
Redox reactions are analogous in that they are el.pdf
                     Redox reactions are analogous in that they are el.pdf                     Redox reactions are analogous in that they are el.pdf
Redox reactions are analogous in that they are el.pdf
anjaliselectionahd
 
moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf
                     moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf                     moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf
moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf
anjaliselectionahd
 
mole fraction of He = mole of He total mole now.pdf
                     mole fraction of He = mole of He total mole  now.pdf                     mole fraction of He = mole of He total mole  now.pdf
mole fraction of He = mole of He total mole now.pdf
anjaliselectionahd
 
It is a molecular process involving the exchange .pdf
                     It is a molecular process involving the exchange .pdf                     It is a molecular process involving the exchange .pdf
It is a molecular process involving the exchange .pdf
anjaliselectionahd
 
Helium contains a 1s^2 orbital. .pdf
                     Helium contains a 1s^2 orbital.                  .pdf                     Helium contains a 1s^2 orbital.                  .pdf
Helium contains a 1s^2 orbital. .pdf
anjaliselectionahd
 
From the LCAO method The overlap of the 1s AO on.pdf
                     From the LCAO method The overlap of the 1s AO on.pdf                     From the LCAO method The overlap of the 1s AO on.pdf
From the LCAO method The overlap of the 1s AO on.pdf
anjaliselectionahd
 
Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+] .pdf
                     Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+]         .pdf                     Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+]         .pdf
Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+] .pdf
anjaliselectionahd
 
condense .pdf
                     condense                                      .pdf                     condense                                      .pdf
condense .pdf
anjaliselectionahd
 
Cis-trans isomers occur because it is impossible .pdf
                     Cis-trans isomers occur because it is impossible .pdf                     Cis-trans isomers occur because it is impossible .pdf
Cis-trans isomers occur because it is impossible .pdf
anjaliselectionahd
 
When a heterozygote (Aa) is not an exact intermediate between the tw.pdf
When a heterozygote (Aa) is not an exact intermediate between the tw.pdfWhen a heterozygote (Aa) is not an exact intermediate between the tw.pdf
When a heterozygote (Aa) is not an exact intermediate between the tw.pdf
anjaliselectionahd
 
Volume of water = masssolubility of calcium phosphate= 13.41 x 1.pdf
Volume of water = masssolubility of calcium phosphate= 13.41 x 1.pdfVolume of water = masssolubility of calcium phosphate= 13.41 x 1.pdf
Volume of water = masssolubility of calcium phosphate= 13.41 x 1.pdf
anjaliselectionahd
 
Astatine is a halogen. Column VII(7) on the perio.pdf
                     Astatine is a halogen. Column VII(7) on the perio.pdf                     Astatine is a halogen. Column VII(7) on the perio.pdf
Astatine is a halogen. Column VII(7) on the perio.pdf
anjaliselectionahd
 

More from anjaliselectionahd (20)

10. The push button is pushed to the second stop when we pipette out.pdf
10. The push button is pushed to the second stop when we pipette out.pdf10. The push button is pushed to the second stop when we pipette out.pdf
10. The push button is pushed to the second stop when we pipette out.pdf
 
1. Working capital is the capital that a company uses for its day to.pdf
1. Working capital is the capital that a company uses for its day to.pdf1. Working capital is the capital that a company uses for its day to.pdf
1. Working capital is the capital that a company uses for its day to.pdf
 
1. no2.The Waterfall model has some disadvantages.Agile software.pdf
1. no2.The Waterfall model has some disadvantages.Agile software.pdf1. no2.The Waterfall model has some disadvantages.Agile software.pdf
1. no2.The Waterfall model has some disadvantages.Agile software.pdf
 
True ; this is known as Tyndal effect .pdf
                     True  ; this is known as Tyndal effect           .pdf                     True  ; this is known as Tyndal effect           .pdf
True ; this is known as Tyndal effect .pdf
 
TLC is used to separate the compounds.the benzoic.pdf
                     TLC is used to separate the compounds.the benzoic.pdf                     TLC is used to separate the compounds.the benzoic.pdf
TLC is used to separate the compounds.the benzoic.pdf
 
The answer to this question is (E) If you look at.pdf
                     The answer to this question is (E) If you look at.pdf                     The answer to this question is (E) If you look at.pdf
The answer to this question is (E) If you look at.pdf
 
sp hybridized orbital Solution .pdf
                     sp hybridized orbital  Solution              .pdf                     sp hybridized orbital  Solution              .pdf
sp hybridized orbital Solution .pdf
 
SO2(g) + H2O(l) - H2SO4(aq) .pdf
                     SO2(g) + H2O(l) - H2SO4(aq)                     .pdf                     SO2(g) + H2O(l) - H2SO4(aq)                     .pdf
SO2(g) + H2O(l) - H2SO4(aq) .pdf
 
Redox reactions are analogous in that they are el.pdf
                     Redox reactions are analogous in that they are el.pdf                     Redox reactions are analogous in that they are el.pdf
Redox reactions are analogous in that they are el.pdf
 
moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf
                     moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf                     moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf
moles NH4NO3 = 2.57 g 80.04 gmol=0.0321 moles H.pdf
 
mole fraction of He = mole of He total mole now.pdf
                     mole fraction of He = mole of He total mole  now.pdf                     mole fraction of He = mole of He total mole  now.pdf
mole fraction of He = mole of He total mole now.pdf
 
It is a molecular process involving the exchange .pdf
                     It is a molecular process involving the exchange .pdf                     It is a molecular process involving the exchange .pdf
It is a molecular process involving the exchange .pdf
 
Helium contains a 1s^2 orbital. .pdf
                     Helium contains a 1s^2 orbital.                  .pdf                     Helium contains a 1s^2 orbital.                  .pdf
Helium contains a 1s^2 orbital. .pdf
 
From the LCAO method The overlap of the 1s AO on.pdf
                     From the LCAO method The overlap of the 1s AO on.pdf                     From the LCAO method The overlap of the 1s AO on.pdf
From the LCAO method The overlap of the 1s AO on.pdf
 
Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+] .pdf
                     Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+]         .pdf                     Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+]         .pdf
Ecell=E(nought) -RT(2F)ln[Mg2+][Zn2+] .pdf
 
condense .pdf
                     condense                                      .pdf                     condense                                      .pdf
condense .pdf
 
Cis-trans isomers occur because it is impossible .pdf
                     Cis-trans isomers occur because it is impossible .pdf                     Cis-trans isomers occur because it is impossible .pdf
Cis-trans isomers occur because it is impossible .pdf
 
When a heterozygote (Aa) is not an exact intermediate between the tw.pdf
When a heterozygote (Aa) is not an exact intermediate between the tw.pdfWhen a heterozygote (Aa) is not an exact intermediate between the tw.pdf
When a heterozygote (Aa) is not an exact intermediate between the tw.pdf
 
Volume of water = masssolubility of calcium phosphate= 13.41 x 1.pdf
Volume of water = masssolubility of calcium phosphate= 13.41 x 1.pdfVolume of water = masssolubility of calcium phosphate= 13.41 x 1.pdf
Volume of water = masssolubility of calcium phosphate= 13.41 x 1.pdf
 
Astatine is a halogen. Column VII(7) on the perio.pdf
                     Astatine is a halogen. Column VII(7) on the perio.pdf                     Astatine is a halogen. Column VII(7) on the perio.pdf
Astatine is a halogen. Column VII(7) on the perio.pdf
 

Recently uploaded

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 

Recently uploaded (20)

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 

Please find my implementationpublic KeyedItem remove() { DO.pdf

  • 1. Please find my implementation: public KeyedItem remove() { //DO THIS //remove the smallest item // since Linked List is in sorted order, so head is the samllest element if(head == null) return null; // return head element and move head one step forward KeyedItem item = head.getItem(); head = head.getNext(); return item; } private Node locateNodeAdd(KeyedItem item) { //DO THIS //find the insertion location (remember FIFO for duplicates) Node curr = head; Node prev = null; while(curr != null){ if((current.getItem().getKey()).compareTo(item.getKey) >= 0){ return prev; } prev = curr; curr = curr.getNext(); } return prev; } Solution
  • 2. Please find my implementation: public KeyedItem remove() { //DO THIS //remove the smallest item // since Linked List is in sorted order, so head is the samllest element if(head == null) return null; // return head element and move head one step forward KeyedItem item = head.getItem(); head = head.getNext(); return item; } private Node locateNodeAdd(KeyedItem item) { //DO THIS //find the insertion location (remember FIFO for duplicates) Node curr = head; Node prev = null; while(curr != null){ if((current.getItem().getKey()).compareTo(item.getKey) >= 0){ return prev; } prev = curr; curr = curr.getNext(); } return prev; }