SlideShare a Scribd company logo
please read below it will tell you what we are using
/**
* LinkedList.java
*
* Replace all //TODO tags with your code
*
* Note that below the "//TODO" tag there may be
* something like "return null;", "return 0;", etc.
* That line is just "stubbed in" so the class
* will compile. When you add your code (one or many
* statements), you will want to delete the "stubbed" line.
* By "stubbed in" we mean "mocked" or "faked in" temporarily.
*
* When testing, construct using the static factory methods:
LinkedList.newEmpty()
LinkedList.from(arrayElements)
*/
package model.list;
import java.lang.reflect.Array;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import model.linearpub.DynamicList;
import model.linearpub.StructureIterator;
//This class is NOT java.util.LinkedList
public class LinkedList<E> implements DynamicList<E> {
//---------------------------------
// Instance Variables
//TODO - declare instance variable(s)
//---------------------------------
// Private Constructor
/** Constructs and returns new LinkedList (no args constructor) */
private LinkedList() {
}
//-------------------- List Statistics ---------------------
/**
* Return number of elements in this list.
*/
@Override
public int size() {
//TODO
return 0;
}
/**
* Return true is this list contains no elements.
*/
@Override
public boolean isEmpty() {
//TODO
return false;
}
//------------------ Accessing Elements --------------------
/**
* Return element at given index.
* Throws IndexOutOfBoundsException if passed index is invalid.
*/
@Override
public E get(int index) {
//TODO
return null;
}
/**
* Return first element
* Throws RuntimeException if list is empty
*/
@Override
public E first() {
//TODO
return null;
}
/**
* Return last element
* Throws RuntimeException if list is empty
*/
@Override
public E last() {
//TODO
return null;
}
/**
* Return a new list containing the elements of this list
* between the given index "start" (inclusive) and
* the given index "stop" (exclusive).
* Throws IndexOutOfBoundsException if either passed index is invalid.
*/
@Override
public DynamicList<E> subList(int start, int stop) {
//TODO
return null;
}
/**
* Return index of first matching element (where searchFct outputs true)
* Return -1 if no match
* Example usage (first list of integers, then employees):
* index = list.find(eaInteger -> eaInteger == 10);
* index = employeeList.find(employee -> employee .getFirstName().equals("Kofi"));
*/
@Override
public int findFirst(Function<E, Boolean> searchFct) {
//TODO
return 0;
}
/**
* Return index of last matching element (where searchFct outputs true)
* E.g., if searching for employee with name "Kofi" and there is a match
* at index=3 and index=8, findLast will return 8 (the last matching index).
* Hint: start search at end of list and work backwards through list.
* Return -1 if no match
*/
@Override
public int findLast(Function<E, Boolean> searchFct) {
//TODO
return 0;
}
//------------------- Setting Elements ---------------------
/**
* Insert passed arg "newElem" into position "index"
* Return previous (replaced) elem at "index"
* Valid "index" values are between 0 and "size - 1"
* If "index" is invalid, throws IndexOutOfBoundsException.
*/
@Override
public E set(int index, E newElem) {
//TODO
return null;
}
//------- Inserting, Appending & Replacing Elements --------
//------------------ (Dynamic Behaviors) ------------------
/**
* Add the passed element to start of list
*/
@Override
public void addFirst(E newElem) {
//TODO
}
/**
* Add the passed element to end of list
*/
@Override
public void addLast(E newElem) {
//TODO
}
/**
* Alias for "addLast" (same functionality)
*/
@Override
public void add(E newElem) {
//TODO
}
/**
* Add all elements from "otherDynList" into "this" list
*/
@Override
public void addAll(DynamicList<E> otherDynList) {
//TODO
}
/**
* Add all elements from passed fixed array "this" list
*/
@Override
public void addAll(E[] array) {
//TODO
}
/**
* Shift to the right the element currently at "insertIndex" (if any) and all elements to the right
* Insert passed arg "newElem" into position "insertIndex"
* Valid "insertIndex" values are between 0 and "size"
* If index = "size" then it becomes a simple "add" operation
* If "insertIndex" is invalid, throws IndexOutOfBoundsException
*/
@Override
public void insert(int insertIndex, E newElem) {
//TODO
}
//------------------- Removing Elements --------------------
//------------------ (Dynamic Behaviors) ------------------
/**
* Remove first element
* Return removed element
* Throws RuntimeException if list is empty
*/
@Override
public E removeFirst() {
//TODO
return null;
}
/**
* Remove last element
* Return removed element
* Throws RuntimeException if list is empty
*/
@Override
public E removeLast() {
//TODO
return null;
}
/**
* Reset the list so it is empty.
* If list is already empty, then do nothing
* No action is performed on the elements.
*
*/
@Override
public void removeAll() {
//TODO
}
/**
* Remove elem at index
* Return the removed element
* Throws IndexOutOfBoundsException if passed index is invalid.
*/
@Override
public E removeIndex(int index) {
//TODO
return null;
}
/**
* Remove first matching element (where searchFct outputs true)
* Return the removed element
* If no match, return null
*/
@Override
public E removeFirstMatching(Function<E, Boolean> searchFct) {
//TODO
return null;
}
//----------------- Convenience Methods ------------------
/** Return this list as array
* This method requires imports of:
* java.lang.reflect.Array;
* java.util.concurrent.atomic.AtomicInteger;
*/
@Override
@SuppressWarnings("unchecked")
public E[] toArray() {
//This method is completed (no work needed)
if (this.isEmpty())
return (E[]) Array.newInstance(Object.class, 0);
StructureIterator<E> iter = this.iterator();
E[] array = (E[]) Array.newInstance(iter.peek().getClass(), this.size());
AtomicInteger counter = new AtomicInteger(0);
this.forEach((each) -> array[counter.getAndIncrement()] = each);
return array;
}
/**
* Returns one-line user-friendly message about this object
* Helpful method especially for debugging.
*/
@Override
public String toString() {
//TODO
return null;
}
/** Prints all elements to console, with newline after each */
@Override
public void printAll() {
//TODO
}
/** Iterates over elements in "this" object. For each element,
* performs actionFct (passing element being iterated on)
* The generic type "? super E" means some type that is
* a superclass of E (inclusive)
*/
@Override
public void forEach(Consumer<? super E> actionFct) {
//TODO
}
/** Return new list that is "this" list joined
* with "otherList" list (this list's elements are
* first followed by the "otherList" list)
*/
@Override
public DynamicList<E> join(DynamicList<E> otherList) {
//TODO
return null;
}
//----------------- Utility Methods ------------------
/**
* Returns new DynamicList with "new elements". Each new element
* is generated from mapFct invoked with an element from
* this list.
*/
@Override
public <T> DynamicList<T> map(Function<E, T> mapFct) {
//TODO
return null;
}
/**
* Returns new DynamicList containing only elements that
* result in true when applied to selectFct
* Returns new DynamicList which is elements
* selected from this list via selectFct
*/
@Override
public DynamicList<E> select(Function<E, Boolean> selectFct) {
//TODO
return null;
}
/**
* Returns new DynamicList which is this list
* with elements rejected via rejectFct
*/
@Override
public DynamicList<E> reject(Function<E, Boolean> rejectFct) {
//TODO
return null;
}
/** Accumulate a value by iterating over the collection
* and accumulating during iteration.
* E.g., accumulate a "sum", or accumulate
* a new collection which is the accumulation
* of sub-collections obtained from elements (think
* of accumulating all players in a league by
* accumulating the players from each team
*/
@Override
public <T> T accumulate(BiFunction<T, E, T> fct, T initialValue) {
//TODO
return null;
}
//---------------------------------
// Public Constructors (Static Factory Constructor Methods)
// These two methods are completed for you
/** Return a new empty LinkedList */
public static <T> DynamicList<T> newEmpty() {
return new LinkedList<>();
}
/** Return a new LinkedList that contains all elements from the
* param "aFixedArray" */
public static <T> DynamicList<T> from(T[] aFixedArray) {
DynamicList<T> list = LinkedList.newEmpty();
for (T nextNewElem: aFixedArray)
list.add(nextNewElem);
return list;
}
//----------------------------------------------------------
/*TODO - helper methods (optional -- coder's choice)
Helper method simply means any methods you
add (your choice) to make coding easier (i.e.,
methods that "help" other methods by doing some
of the work. The other methods call the "helper
methods".
*/
}

More Related Content

Similar to please read below it will tell you what we are using L.pdf

LabProgram.javaimport java.util.NoSuchElementException;public .pdf
LabProgram.javaimport java.util.NoSuchElementException;public .pdfLabProgram.javaimport java.util.NoSuchElementException;public .pdf
LabProgram.javaimport java.util.NoSuchElementException;public .pdf
fantasiatheoutofthef
 
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
Java Foundations StackADT-java ---  - Defines the interface to a stack.docxJava Foundations StackADT-java ---  - Defines the interface to a stack.docx
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
VictorXUQGloverl
 
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdfAll code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
akashenterprises93
 
Class DiagramIn the Assignment #10, you are given three files Ass.pdf
Class DiagramIn the Assignment #10, you are given three files Ass.pdfClass DiagramIn the Assignment #10, you are given three files Ass.pdf
Class DiagramIn the Assignment #10, you are given three files Ass.pdf
xlynettalampleyxc
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
accostinternational
 
Please help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfPlease help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdf
seoagam1
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
Conint29
 
Note- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdfNote- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdf
Stewart29UReesa
 
File LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdfFile LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdf
Conint29
 
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdfNote- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
Augstore
 
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
 
Note- Can someone help me with the private E get(int index- int curren (1).docx
Note- Can someone help me with the private E get(int index- int curren (1).docxNote- Can someone help me with the private E get(int index- int curren (1).docx
Note- Can someone help me with the private E get(int index- int curren (1).docx
VictorzH8Bondx
 
package ADTs public interface CollectionADTltTgt .pdf
package ADTs public interface CollectionADTltTgt      .pdfpackage ADTs public interface CollectionADTltTgt      .pdf
package ADTs public interface CollectionADTltTgt .pdf
syedabdul78662
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
davidwarner122
 
StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
ARCHANASTOREKOTA
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
JamesPXNNewmanp
 
EmptyCollectionException-java -- - Represents the situation in which.docx
EmptyCollectionException-java --  - Represents the situation in which.docxEmptyCollectionException-java --  - Represents the situation in which.docx
EmptyCollectionException-java -- - Represents the situation in which.docx
BlakeSGMHemmingss
 
package linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfpackage linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdf
arcellzone
 
Describe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdfDescribe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdf
deepak596396
 
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
 

Similar to please read below it will tell you what we are using L.pdf (20)

LabProgram.javaimport java.util.NoSuchElementException;public .pdf
LabProgram.javaimport java.util.NoSuchElementException;public .pdfLabProgram.javaimport java.util.NoSuchElementException;public .pdf
LabProgram.javaimport java.util.NoSuchElementException;public .pdf
 
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
Java Foundations StackADT-java ---  - Defines the interface to a stack.docxJava Foundations StackADT-java ---  - Defines the interface to a stack.docx
Java Foundations StackADT-java --- - Defines the interface to a stack.docx
 
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdfAll code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
 
Class DiagramIn the Assignment #10, you are given three files Ass.pdf
Class DiagramIn the Assignment #10, you are given three files Ass.pdfClass DiagramIn the Assignment #10, you are given three files Ass.pdf
Class DiagramIn the Assignment #10, you are given three files Ass.pdf
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
 
Please help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdfPlease help me to make a programming project I have to sue them today- (1).pdf
Please help me to make a programming project I have to sue them today- (1).pdf
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
 
Note- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdfNote- Can someone help me with the Public boolean add(E value) method.pdf
Note- Can someone help me with the Public boolean add(E value) method.pdf
 
File LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdfFile LinkedList.java Defines a doubly-l.pdf
File LinkedList.java Defines a doubly-l.pdf
 
Note- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.pdfNote- Can someone help me with the public boolean isEmpty()- public bo.pdf
Note- Can someone help me with the public boolean isEmpty()- public bo.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
 
Note- Can someone help me with the private E get(int index- int curren (1).docx
Note- Can someone help me with the private E get(int index- int curren (1).docxNote- Can someone help me with the private E get(int index- int curren (1).docx
Note- Can someone help me with the private E get(int index- int curren (1).docx
 
package ADTs public interface CollectionADTltTgt .pdf
package ADTs public interface CollectionADTltTgt      .pdfpackage ADTs public interface CollectionADTltTgt      .pdf
package ADTs public interface CollectionADTltTgt .pdf
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
 
StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
 
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdfProblem- Describe an algorithm for concatenating two singly linked lis.pdf
Problem- Describe an algorithm for concatenating two singly linked lis.pdf
 
EmptyCollectionException-java -- - Represents the situation in which.docx
EmptyCollectionException-java --  - Represents the situation in which.docxEmptyCollectionException-java --  - Represents the situation in which.docx
EmptyCollectionException-java -- - Represents the situation in which.docx
 
package linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfpackage linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdf
 
Describe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdfDescribe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.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
 

More from ankit11134

Please modify the following code in C Here is the initial c.pdf
Please modify the following code in C Here is the initial c.pdfPlease modify the following code in C Here is the initial c.pdf
Please modify the following code in C Here is the initial c.pdf
ankit11134
 
Please read below instruction and please give me answer 1.pdf
Please read below instruction and please give me answer   1.pdfPlease read below instruction and please give me answer   1.pdf
Please read below instruction and please give me answer 1.pdf
ankit11134
 
Please read Sections 13 of the following paper Yufei Tao.pdf
Please read Sections 13 of the following paper  Yufei Tao.pdfPlease read Sections 13 of the following paper  Yufei Tao.pdf
Please read Sections 13 of the following paper Yufei Tao.pdf
ankit11134
 
Please provide all necessary steps b Let 2XEX+VarX.pdf
Please provide all necessary steps b Let 2XEX+VarX.pdfPlease provide all necessary steps b Let 2XEX+VarX.pdf
Please provide all necessary steps b Let 2XEX+VarX.pdf
ankit11134
 
Please provide a 150200 word response per question and incl.pdf
Please provide a 150200 word response per question and incl.pdfPlease provide a 150200 word response per question and incl.pdf
Please provide a 150200 word response per question and incl.pdf
ankit11134
 
Please only write java classes according to diagram below I.pdf
Please only write java classes according to diagram below I.pdfPlease only write java classes according to diagram below I.pdf
Please only write java classes according to diagram below I.pdf
ankit11134
 
Please mention Chicago style REFERENCES How Tourism Works A.pdf
Please mention Chicago style REFERENCES How Tourism Works A.pdfPlease mention Chicago style REFERENCES How Tourism Works A.pdf
Please mention Chicago style REFERENCES How Tourism Works A.pdf
ankit11134
 
Please present complete solution The data in the table below.pdf
Please present complete solution The data in the table below.pdfPlease present complete solution The data in the table below.pdf
Please present complete solution The data in the table below.pdf
ankit11134
 
Please pick a relevant company or make one up Consider the .pdf
Please pick a relevant company or make one up Consider the .pdfPlease pick a relevant company or make one up Consider the .pdf
Please pick a relevant company or make one up Consider the .pdf
ankit11134
 
Please help with the concept map for eukaryotic transcriptio.pdf
Please help with the concept map for eukaryotic transcriptio.pdfPlease help with the concept map for eukaryotic transcriptio.pdf
Please help with the concept map for eukaryotic transcriptio.pdf
ankit11134
 
Please modify the following code in C Make sure your code m.pdf
Please modify the following code in C Make sure your code m.pdfPlease modify the following code in C Make sure your code m.pdf
Please modify the following code in C Make sure your code m.pdf
ankit11134
 
Please match using only the given options Match the definiti.pdf
Please match using only the given options Match the definiti.pdfPlease match using only the given options Match the definiti.pdf
Please match using only the given options Match the definiti.pdf
ankit11134
 
Please match each component of the logic model presented her.pdf
Please match each component of the logic model presented her.pdfPlease match each component of the logic model presented her.pdf
Please match each component of the logic model presented her.pdf
ankit11134
 
please make feedbackcomment or response to this post Pro.pdf
please make feedbackcomment or response to this post   Pro.pdfplease make feedbackcomment or response to this post   Pro.pdf
please make feedbackcomment or response to this post Pro.pdf
ankit11134
 
please make feedbackcomment or response to this post Being.pdf
please make feedbackcomment or response to this post Being.pdfplease make feedbackcomment or response to this post Being.pdf
please make feedbackcomment or response to this post Being.pdf
ankit11134
 
Please make a lab report with the following Linux command li.pdf
Please make a lab report with the following Linux command li.pdfPlease make a lab report with the following Linux command li.pdf
Please make a lab report with the following Linux command li.pdf
ankit11134
 
Please label the image given characteristics Basement me.pdf
Please label the image given characteristics   Basement me.pdfPlease label the image given characteristics   Basement me.pdf
Please label the image given characteristics Basement me.pdf
ankit11134
 
Please include formulas This problem is based on a real acqu.pdf
Please include formulas This problem is based on a real acqu.pdfPlease include formulas This problem is based on a real acqu.pdf
Please include formulas This problem is based on a real acqu.pdf
ankit11134
 
Please help Two firms engage in simultaneousmove quantity .pdf
Please help Two firms engage in simultaneousmove quantity .pdfPlease help Two firms engage in simultaneousmove quantity .pdf
Please help Two firms engage in simultaneousmove quantity .pdf
ankit11134
 
Please include all code and scripts will thumbs up Model o.pdf
Please include all code and scripts will thumbs up Model o.pdfPlease include all code and scripts will thumbs up Model o.pdf
Please include all code and scripts will thumbs up Model o.pdf
ankit11134
 

More from ankit11134 (20)

Please modify the following code in C Here is the initial c.pdf
Please modify the following code in C Here is the initial c.pdfPlease modify the following code in C Here is the initial c.pdf
Please modify the following code in C Here is the initial c.pdf
 
Please read below instruction and please give me answer 1.pdf
Please read below instruction and please give me answer   1.pdfPlease read below instruction and please give me answer   1.pdf
Please read below instruction and please give me answer 1.pdf
 
Please read Sections 13 of the following paper Yufei Tao.pdf
Please read Sections 13 of the following paper  Yufei Tao.pdfPlease read Sections 13 of the following paper  Yufei Tao.pdf
Please read Sections 13 of the following paper Yufei Tao.pdf
 
Please provide all necessary steps b Let 2XEX+VarX.pdf
Please provide all necessary steps b Let 2XEX+VarX.pdfPlease provide all necessary steps b Let 2XEX+VarX.pdf
Please provide all necessary steps b Let 2XEX+VarX.pdf
 
Please provide a 150200 word response per question and incl.pdf
Please provide a 150200 word response per question and incl.pdfPlease provide a 150200 word response per question and incl.pdf
Please provide a 150200 word response per question and incl.pdf
 
Please only write java classes according to diagram below I.pdf
Please only write java classes according to diagram below I.pdfPlease only write java classes according to diagram below I.pdf
Please only write java classes according to diagram below I.pdf
 
Please mention Chicago style REFERENCES How Tourism Works A.pdf
Please mention Chicago style REFERENCES How Tourism Works A.pdfPlease mention Chicago style REFERENCES How Tourism Works A.pdf
Please mention Chicago style REFERENCES How Tourism Works A.pdf
 
Please present complete solution The data in the table below.pdf
Please present complete solution The data in the table below.pdfPlease present complete solution The data in the table below.pdf
Please present complete solution The data in the table below.pdf
 
Please pick a relevant company or make one up Consider the .pdf
Please pick a relevant company or make one up Consider the .pdfPlease pick a relevant company or make one up Consider the .pdf
Please pick a relevant company or make one up Consider the .pdf
 
Please help with the concept map for eukaryotic transcriptio.pdf
Please help with the concept map for eukaryotic transcriptio.pdfPlease help with the concept map for eukaryotic transcriptio.pdf
Please help with the concept map for eukaryotic transcriptio.pdf
 
Please modify the following code in C Make sure your code m.pdf
Please modify the following code in C Make sure your code m.pdfPlease modify the following code in C Make sure your code m.pdf
Please modify the following code in C Make sure your code m.pdf
 
Please match using only the given options Match the definiti.pdf
Please match using only the given options Match the definiti.pdfPlease match using only the given options Match the definiti.pdf
Please match using only the given options Match the definiti.pdf
 
Please match each component of the logic model presented her.pdf
Please match each component of the logic model presented her.pdfPlease match each component of the logic model presented her.pdf
Please match each component of the logic model presented her.pdf
 
please make feedbackcomment or response to this post Pro.pdf
please make feedbackcomment or response to this post   Pro.pdfplease make feedbackcomment or response to this post   Pro.pdf
please make feedbackcomment or response to this post Pro.pdf
 
please make feedbackcomment or response to this post Being.pdf
please make feedbackcomment or response to this post Being.pdfplease make feedbackcomment or response to this post Being.pdf
please make feedbackcomment or response to this post Being.pdf
 
Please make a lab report with the following Linux command li.pdf
Please make a lab report with the following Linux command li.pdfPlease make a lab report with the following Linux command li.pdf
Please make a lab report with the following Linux command li.pdf
 
Please label the image given characteristics Basement me.pdf
Please label the image given characteristics   Basement me.pdfPlease label the image given characteristics   Basement me.pdf
Please label the image given characteristics Basement me.pdf
 
Please include formulas This problem is based on a real acqu.pdf
Please include formulas This problem is based on a real acqu.pdfPlease include formulas This problem is based on a real acqu.pdf
Please include formulas This problem is based on a real acqu.pdf
 
Please help Two firms engage in simultaneousmove quantity .pdf
Please help Two firms engage in simultaneousmove quantity .pdfPlease help Two firms engage in simultaneousmove quantity .pdf
Please help Two firms engage in simultaneousmove quantity .pdf
 
Please include all code and scripts will thumbs up Model o.pdf
Please include all code and scripts will thumbs up Model o.pdfPlease include all code and scripts will thumbs up Model o.pdf
Please include all code and scripts will thumbs up Model o.pdf
 

Recently uploaded

ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
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
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
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
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
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
 
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
 
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
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 

Recently uploaded (20)

ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
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
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
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
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
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
 
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
 
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
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 

please read below it will tell you what we are using L.pdf

  • 1. please read below it will tell you what we are using /** * LinkedList.java * * Replace all //TODO tags with your code * * Note that below the "//TODO" tag there may be * something like "return null;", "return 0;", etc. * That line is just "stubbed in" so the class * will compile. When you add your code (one or many * statements), you will want to delete the "stubbed" line. * By "stubbed in" we mean "mocked" or "faked in" temporarily. * * When testing, construct using the static factory methods: LinkedList.newEmpty() LinkedList.from(arrayElements) */ package model.list; import java.lang.reflect.Array; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; import model.linearpub.DynamicList; import model.linearpub.StructureIterator; //This class is NOT java.util.LinkedList public class LinkedList<E> implements DynamicList<E> { //--------------------------------- // Instance Variables //TODO - declare instance variable(s) //--------------------------------- // Private Constructor /** Constructs and returns new LinkedList (no args constructor) */ private LinkedList() { } //-------------------- List Statistics --------------------- /** * Return number of elements in this list. */ @Override public int size() { //TODO
  • 2. return 0; } /** * Return true is this list contains no elements. */ @Override public boolean isEmpty() { //TODO return false; } //------------------ Accessing Elements -------------------- /** * Return element at given index. * Throws IndexOutOfBoundsException if passed index is invalid. */ @Override public E get(int index) { //TODO return null; } /** * Return first element * Throws RuntimeException if list is empty */ @Override public E first() { //TODO return null; } /** * Return last element * Throws RuntimeException if list is empty */ @Override public E last() { //TODO return null; } /** * Return a new list containing the elements of this list * between the given index "start" (inclusive) and * the given index "stop" (exclusive).
  • 3. * Throws IndexOutOfBoundsException if either passed index is invalid. */ @Override public DynamicList<E> subList(int start, int stop) { //TODO return null; } /** * Return index of first matching element (where searchFct outputs true) * Return -1 if no match * Example usage (first list of integers, then employees): * index = list.find(eaInteger -> eaInteger == 10); * index = employeeList.find(employee -> employee .getFirstName().equals("Kofi")); */ @Override public int findFirst(Function<E, Boolean> searchFct) { //TODO return 0; } /** * Return index of last matching element (where searchFct outputs true) * E.g., if searching for employee with name "Kofi" and there is a match * at index=3 and index=8, findLast will return 8 (the last matching index). * Hint: start search at end of list and work backwards through list. * Return -1 if no match */ @Override public int findLast(Function<E, Boolean> searchFct) { //TODO return 0; } //------------------- Setting Elements --------------------- /** * Insert passed arg "newElem" into position "index" * Return previous (replaced) elem at "index" * Valid "index" values are between 0 and "size - 1" * If "index" is invalid, throws IndexOutOfBoundsException. */ @Override public E set(int index, E newElem) { //TODO return null;
  • 4. } //------- Inserting, Appending & Replacing Elements -------- //------------------ (Dynamic Behaviors) ------------------ /** * Add the passed element to start of list */ @Override public void addFirst(E newElem) { //TODO } /** * Add the passed element to end of list */ @Override public void addLast(E newElem) { //TODO } /** * Alias for "addLast" (same functionality) */ @Override public void add(E newElem) { //TODO } /** * Add all elements from "otherDynList" into "this" list */ @Override public void addAll(DynamicList<E> otherDynList) { //TODO } /** * Add all elements from passed fixed array "this" list */ @Override public void addAll(E[] array) { //TODO } /** * Shift to the right the element currently at "insertIndex" (if any) and all elements to the right * Insert passed arg "newElem" into position "insertIndex" * Valid "insertIndex" values are between 0 and "size"
  • 5. * If index = "size" then it becomes a simple "add" operation * If "insertIndex" is invalid, throws IndexOutOfBoundsException */ @Override public void insert(int insertIndex, E newElem) { //TODO } //------------------- Removing Elements -------------------- //------------------ (Dynamic Behaviors) ------------------ /** * Remove first element * Return removed element * Throws RuntimeException if list is empty */ @Override public E removeFirst() { //TODO return null; } /** * Remove last element * Return removed element * Throws RuntimeException if list is empty */ @Override public E removeLast() { //TODO return null; } /** * Reset the list so it is empty. * If list is already empty, then do nothing * No action is performed on the elements. * */ @Override public void removeAll() { //TODO } /** * Remove elem at index * Return the removed element
  • 6. * Throws IndexOutOfBoundsException if passed index is invalid. */ @Override public E removeIndex(int index) { //TODO return null; } /** * Remove first matching element (where searchFct outputs true) * Return the removed element * If no match, return null */ @Override public E removeFirstMatching(Function<E, Boolean> searchFct) { //TODO return null; } //----------------- Convenience Methods ------------------ /** Return this list as array * This method requires imports of: * java.lang.reflect.Array; * java.util.concurrent.atomic.AtomicInteger; */ @Override @SuppressWarnings("unchecked") public E[] toArray() { //This method is completed (no work needed) if (this.isEmpty()) return (E[]) Array.newInstance(Object.class, 0); StructureIterator<E> iter = this.iterator(); E[] array = (E[]) Array.newInstance(iter.peek().getClass(), this.size()); AtomicInteger counter = new AtomicInteger(0); this.forEach((each) -> array[counter.getAndIncrement()] = each); return array; } /** * Returns one-line user-friendly message about this object * Helpful method especially for debugging. */ @Override public String toString() { //TODO
  • 7. return null; } /** Prints all elements to console, with newline after each */ @Override public void printAll() { //TODO } /** Iterates over elements in "this" object. For each element, * performs actionFct (passing element being iterated on) * The generic type "? super E" means some type that is * a superclass of E (inclusive) */ @Override public void forEach(Consumer<? super E> actionFct) { //TODO } /** Return new list that is "this" list joined * with "otherList" list (this list's elements are * first followed by the "otherList" list) */ @Override public DynamicList<E> join(DynamicList<E> otherList) { //TODO return null; } //----------------- Utility Methods ------------------ /** * Returns new DynamicList with "new elements". Each new element * is generated from mapFct invoked with an element from * this list. */ @Override public <T> DynamicList<T> map(Function<E, T> mapFct) { //TODO return null; } /** * Returns new DynamicList containing only elements that * result in true when applied to selectFct * Returns new DynamicList which is elements * selected from this list via selectFct */
  • 8. @Override public DynamicList<E> select(Function<E, Boolean> selectFct) { //TODO return null; } /** * Returns new DynamicList which is this list * with elements rejected via rejectFct */ @Override public DynamicList<E> reject(Function<E, Boolean> rejectFct) { //TODO return null; } /** Accumulate a value by iterating over the collection * and accumulating during iteration. * E.g., accumulate a "sum", or accumulate * a new collection which is the accumulation * of sub-collections obtained from elements (think * of accumulating all players in a league by * accumulating the players from each team */ @Override public <T> T accumulate(BiFunction<T, E, T> fct, T initialValue) { //TODO return null; } //--------------------------------- // Public Constructors (Static Factory Constructor Methods) // These two methods are completed for you /** Return a new empty LinkedList */ public static <T> DynamicList<T> newEmpty() { return new LinkedList<>(); } /** Return a new LinkedList that contains all elements from the * param "aFixedArray" */ public static <T> DynamicList<T> from(T[] aFixedArray) { DynamicList<T> list = LinkedList.newEmpty(); for (T nextNewElem: aFixedArray) list.add(nextNewElem); return list; }
  • 9. //---------------------------------------------------------- /*TODO - helper methods (optional -- coder's choice) Helper method simply means any methods you add (your choice) to make coding easier (i.e., methods that "help" other methods by doing some of the work. The other methods call the "helper methods". */ }