SlideShare a Scribd company logo
please read the steps below and it will tell you what we using
/**
* DynamicArray.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:
DynamicList.newEmpty()
DynamicList.fromGrowthFactor(growthFactor)
DynamicList.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;
public class DynamicArray<E> implements DynamicList<E> {
//---------------------------------
// Instance Variables
//TODO - declare instance variable(s)
//---------------------------------
// Private Constructors
/** Constructs and returns new DynamicArray (no args constructor) */
private DynamicArray() {
this(defaultGrowthFactor());
}
/** Constructs and returns new DynamicArray with "aGrowthFactor" */
private DynamicArray(double aGrowthFactor) {
//TODO -- this is the constructor that should
//initialize the dynamic array as needed
}
//------------------------------------------------
public static double defaultGrowthFactor() {
//TODO - replace 0 with a good growth factor
return 0;
}
protected static int defaultInitialCapacity() {
//TODO - replace 0 with a good initial capacity
return 0;
}
//-------------------- 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 three methods are completed for you
/** Returns a new empty DynamicList */
public static <T> DynamicList<T> newEmpty() {
return new DynamicArray<>();
}
/** Return a new empty DynamicArray with "growthFactor" */
public static <T> DynamicList<T> fromGrowthFactor(double growthFactor) {
return new DynamicArray<>(growthFactor);
}
/** Return a new DynamicList that contains all elements from the
* param "aFixedArray" */
public static <T> DynamicList<T> from(T[] aFixedArray) {
DynamicList<T> dynamic = new DynamicArray<>(defaultGrowthFactor());
for (T nextNewElem: aFixedArray)
dynamic.add(nextNewElem);
return dynamic;
}
//----------------------------------------------------------
/*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 the steps below and it will tell you what we usi.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.docxVictorXUQGloverl
 
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).pdfseoagam1
 
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 .pdffantasiatheoutofthef
 
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.pdfStewart29UReesa
 
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.pdfakashenterprises93
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfaccostinternational
 
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.pdfxlynettalampleyxc
 
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).docxVictorzH8Bondx
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdfConint29
 
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.pdfAugstore
 
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.pdfConint29
 
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.pdfmaheshkumar12354
 
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.pdfARCHANASTOREKOTA
 
package ADTs public interface CollectionADTltTgt .pdf
package ADTs public interface CollectionADTltTgt      .pdfpackage ADTs public interface CollectionADTltTgt      .pdf
package ADTs public interface CollectionADTltTgt .pdfsyedabdul78662
 
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
 
java write a program to evaluate the postfix expressionthe program.pdf
java write a program to evaluate the postfix expressionthe program.pdfjava write a program to evaluate the postfix expressionthe program.pdf
java write a program to evaluate the postfix expressionthe program.pdfarjuntelecom26
 
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxNew folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxcurwenmichaela
 
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.docxBlakeSGMHemmingss
 
For this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdfFor this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdffashiongallery1
 

Similar to please read the steps below and it will tell you what we usi.pdf (20)

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
 
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
 
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
 
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
 
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
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.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
 
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
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.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
 
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
 
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
 
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
 
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...
 
java write a program to evaluate the postfix expressionthe program.pdf
java write a program to evaluate the postfix expressionthe program.pdfjava write a program to evaluate the postfix expressionthe program.pdf
java write a program to evaluate the postfix expressionthe program.pdf
 
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docxNew folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
New folderjsjfArrayStack.classpackage jsjf;publicsynchronize.docx
 
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
 
Posfix
PosfixPosfix
Posfix
 
For this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdfFor this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdf
 

More from aggarwalopticalsco

Please watch the video and answer the questions Streams.pdf
Please watch the video and answer the questions    Streams.pdfPlease watch the video and answer the questions    Streams.pdf
Please watch the video and answer the questions Streams.pdfaggarwalopticalsco
 
Please user C WPF and provide complete code and screenshot .pdf
Please user C WPF and provide complete code and screenshot .pdfPlease user C WPF and provide complete code and screenshot .pdf
Please user C WPF and provide complete code and screenshot .pdfaggarwalopticalsco
 
Please use the Addition Calculator as a base for your co.pdf
Please use the Addition Calculator as a base for your co.pdfPlease use the Addition Calculator as a base for your co.pdf
Please use the Addition Calculator as a base for your co.pdfaggarwalopticalsco
 
Please use Excel Calculations 9What is the net pr.pdf
Please use Excel Calculations   9What is the net pr.pdfPlease use Excel Calculations   9What is the net pr.pdf
Please use Excel Calculations 9What is the net pr.pdfaggarwalopticalsco
 
Please Urgent Draw the EER diagram for the Hiking Database.pdf
Please Urgent  Draw the EER diagram for the Hiking Database.pdfPlease Urgent  Draw the EER diagram for the Hiking Database.pdf
Please Urgent Draw the EER diagram for the Hiking Database.pdfaggarwalopticalsco
 
Please use any example Consider the international strategy.pdf
Please use any example  Consider the international strategy.pdfPlease use any example  Consider the international strategy.pdf
Please use any example Consider the international strategy.pdfaggarwalopticalsco
 
Please upload a word document of your responses I Assuming.pdf
Please upload a word document of your responses I Assuming.pdfPlease upload a word document of your responses I Assuming.pdf
Please upload a word document of your responses I Assuming.pdfaggarwalopticalsco
 
PLEASE USE TuProlog for this Also the facts need to be Bi.pdf
PLEASE USE  TuProlog  for this Also the facts need to be Bi.pdfPLEASE USE  TuProlog  for this Also the facts need to be Bi.pdf
PLEASE USE TuProlog for this Also the facts need to be Bi.pdfaggarwalopticalsco
 
Please to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdfPlease to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdfaggarwalopticalsco
 
Please type your asnwer for a better rating 4 Explain f.pdf
Please type your asnwer for a better rating    4 Explain f.pdfPlease type your asnwer for a better rating    4 Explain f.pdf
Please type your asnwer for a better rating 4 Explain f.pdfaggarwalopticalsco
 
Please tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdfPlease tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdfaggarwalopticalsco
 
Please solve the TODO parts of the following probelm incl.pdf
Please solve the TODO parts of the following probelm  incl.pdfPlease solve the TODO parts of the following probelm  incl.pdf
Please solve the TODO parts of the following probelm incl.pdfaggarwalopticalsco
 
Please solve the TODO parts include LinkedListcpph tem.pdf
Please solve the TODO parts  include LinkedListcpph tem.pdfPlease solve the TODO parts  include LinkedListcpph tem.pdf
Please solve the TODO parts include LinkedListcpph tem.pdfaggarwalopticalsco
 
Please solve the following problem Make a program that dete.pdf
Please solve the following problem Make a program that dete.pdfPlease solve the following problem Make a program that dete.pdf
Please solve the following problem Make a program that dete.pdfaggarwalopticalsco
 
please show steps Consider the function fxyzz968x63.pdf
please show steps Consider the function fxyzz968x63.pdfplease show steps Consider the function fxyzz968x63.pdf
please show steps Consider the function fxyzz968x63.pdfaggarwalopticalsco
 
please solve in Java language not in other language Instruct.pdf
please solve in Java language not in other language Instruct.pdfplease solve in Java language not in other language Instruct.pdf
please solve in Java language not in other language Instruct.pdfaggarwalopticalsco
 
please solve fast ND correctlyits urgent An animal that i.pdf
please solve fast ND correctlyits urgent An animal that i.pdfplease solve fast ND correctlyits urgent An animal that i.pdf
please solve fast ND correctlyits urgent An animal that i.pdfaggarwalopticalsco
 
please solve all parts as they are the same question but MCQ.pdf
please solve all parts as they are the same question but MCQ.pdfplease solve all parts as they are the same question but MCQ.pdf
please solve all parts as they are the same question but MCQ.pdfaggarwalopticalsco
 
Please show your calculations and complete the table 3 Co.pdf
Please show your calculations and complete the table  3 Co.pdfPlease show your calculations and complete the table  3 Co.pdf
Please show your calculations and complete the table 3 Co.pdfaggarwalopticalsco
 
Please show work on paper For the general loan of amount L t.pdf
Please show work on paper For the general loan of amount L t.pdfPlease show work on paper For the general loan of amount L t.pdf
Please show work on paper For the general loan of amount L t.pdfaggarwalopticalsco
 

More from aggarwalopticalsco (20)

Please watch the video and answer the questions Streams.pdf
Please watch the video and answer the questions    Streams.pdfPlease watch the video and answer the questions    Streams.pdf
Please watch the video and answer the questions Streams.pdf
 
Please user C WPF and provide complete code and screenshot .pdf
Please user C WPF and provide complete code and screenshot .pdfPlease user C WPF and provide complete code and screenshot .pdf
Please user C WPF and provide complete code and screenshot .pdf
 
Please use the Addition Calculator as a base for your co.pdf
Please use the Addition Calculator as a base for your co.pdfPlease use the Addition Calculator as a base for your co.pdf
Please use the Addition Calculator as a base for your co.pdf
 
Please use Excel Calculations 9What is the net pr.pdf
Please use Excel Calculations   9What is the net pr.pdfPlease use Excel Calculations   9What is the net pr.pdf
Please use Excel Calculations 9What is the net pr.pdf
 
Please Urgent Draw the EER diagram for the Hiking Database.pdf
Please Urgent  Draw the EER diagram for the Hiking Database.pdfPlease Urgent  Draw the EER diagram for the Hiking Database.pdf
Please Urgent Draw the EER diagram for the Hiking Database.pdf
 
Please use any example Consider the international strategy.pdf
Please use any example  Consider the international strategy.pdfPlease use any example  Consider the international strategy.pdf
Please use any example Consider the international strategy.pdf
 
Please upload a word document of your responses I Assuming.pdf
Please upload a word document of your responses I Assuming.pdfPlease upload a word document of your responses I Assuming.pdf
Please upload a word document of your responses I Assuming.pdf
 
PLEASE USE TuProlog for this Also the facts need to be Bi.pdf
PLEASE USE  TuProlog  for this Also the facts need to be Bi.pdfPLEASE USE  TuProlog  for this Also the facts need to be Bi.pdf
PLEASE USE TuProlog for this Also the facts need to be Bi.pdf
 
Please to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdfPlease to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdf
 
Please type your asnwer for a better rating 4 Explain f.pdf
Please type your asnwer for a better rating    4 Explain f.pdfPlease type your asnwer for a better rating    4 Explain f.pdf
Please type your asnwer for a better rating 4 Explain f.pdf
 
Please tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdfPlease tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdf
 
Please solve the TODO parts of the following probelm incl.pdf
Please solve the TODO parts of the following probelm  incl.pdfPlease solve the TODO parts of the following probelm  incl.pdf
Please solve the TODO parts of the following probelm incl.pdf
 
Please solve the TODO parts include LinkedListcpph tem.pdf
Please solve the TODO parts  include LinkedListcpph tem.pdfPlease solve the TODO parts  include LinkedListcpph tem.pdf
Please solve the TODO parts include LinkedListcpph tem.pdf
 
Please solve the following problem Make a program that dete.pdf
Please solve the following problem Make a program that dete.pdfPlease solve the following problem Make a program that dete.pdf
Please solve the following problem Make a program that dete.pdf
 
please show steps Consider the function fxyzz968x63.pdf
please show steps Consider the function fxyzz968x63.pdfplease show steps Consider the function fxyzz968x63.pdf
please show steps Consider the function fxyzz968x63.pdf
 
please solve in Java language not in other language Instruct.pdf
please solve in Java language not in other language Instruct.pdfplease solve in Java language not in other language Instruct.pdf
please solve in Java language not in other language Instruct.pdf
 
please solve fast ND correctlyits urgent An animal that i.pdf
please solve fast ND correctlyits urgent An animal that i.pdfplease solve fast ND correctlyits urgent An animal that i.pdf
please solve fast ND correctlyits urgent An animal that i.pdf
 
please solve all parts as they are the same question but MCQ.pdf
please solve all parts as they are the same question but MCQ.pdfplease solve all parts as they are the same question but MCQ.pdf
please solve all parts as they are the same question but MCQ.pdf
 
Please show your calculations and complete the table 3 Co.pdf
Please show your calculations and complete the table  3 Co.pdfPlease show your calculations and complete the table  3 Co.pdf
Please show your calculations and complete the table 3 Co.pdf
 
Please show work on paper For the general loan of amount L t.pdf
Please show work on paper For the general loan of amount L t.pdfPlease show work on paper For the general loan of amount L t.pdf
Please show work on paper For the general loan of amount L t.pdf
 

Recently uploaded

The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...sanghavirahi2
 
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.pptxbennyroshan06
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesTechSoup
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesRased Khan
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...Denish Jangid
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online PresentationGDSCYCCE
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePedroFerreira53928
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfQucHHunhnh
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxShibin Azad
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptSourabh Kumar
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXMIRIAMSALINAS13
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...Nguyen Thanh Tu Collection
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxJenilouCasareno
 
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..pptxEduSkills OECD
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 
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.pptxJheel Barad
 

Recently uploaded (20)

The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...
 
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
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security Services
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matrices
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
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
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
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
 

please read the steps below and it will tell you what we usi.pdf

  • 1. please read the steps below and it will tell you what we using /** * DynamicArray.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: DynamicList.newEmpty() DynamicList.fromGrowthFactor(growthFactor) DynamicList.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; public class DynamicArray<E> implements DynamicList<E> { //--------------------------------- // Instance Variables //TODO - declare instance variable(s) //--------------------------------- // Private Constructors /** Constructs and returns new DynamicArray (no args constructor) */ private DynamicArray() { this(defaultGrowthFactor()); } /** Constructs and returns new DynamicArray with "aGrowthFactor" */ private DynamicArray(double aGrowthFactor) { //TODO -- this is the constructor that should //initialize the dynamic array as needed } //------------------------------------------------
  • 2. public static double defaultGrowthFactor() { //TODO - replace 0 with a good growth factor return 0; } protected static int defaultInitialCapacity() { //TODO - replace 0 with a good initial capacity return 0; } //-------------------- 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
  • 3. 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
  • 4. 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 */
  • 5. @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
  • 6. 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)
  • 7. 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 ------------------ /**
  • 8. * 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; }
  • 9. //--------------------------------- // Public Constructors (Static Factory Constructor Methods) // These three methods are completed for you /** Returns a new empty DynamicList */ public static <T> DynamicList<T> newEmpty() { return new DynamicArray<>(); } /** Return a new empty DynamicArray with "growthFactor" */ public static <T> DynamicList<T> fromGrowthFactor(double growthFactor) { return new DynamicArray<>(growthFactor); } /** Return a new DynamicList that contains all elements from the * param "aFixedArray" */ public static <T> DynamicList<T> from(T[] aFixedArray) { DynamicList<T> dynamic = new DynamicArray<>(defaultGrowthFactor()); for (T nextNewElem: aFixedArray) dynamic.add(nextNewElem); return dynamic; } //---------------------------------------------------------- /*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". */ }