Computers and Technology, 05.03.2021 02:20 dimakamal9370
Can someone urgently help me with my java code (I WILL GIVE BRAINLIEST)?! Ive been working on it for hours and its not working! (please give an actual answer...)
*examples of required output at the bottom*
code: public class CircularList
{
private ListNode head;
private ListNode tail;
private int size;
public CircularList()
{
head = tail = null;
size = 0;
}
public int size()
{
return size;
}
public boolean isEmpty()
{
return (size == 0);
}
public int first()
{
if (head != null) {
return head. getValue();
}
return -1;
}
public Integer last()
{
if (tail != null) {
return tail. getValue();
}
return -1;
}
public void addFirst(Integer value)
{
head = new ListNode(value, head);
if (tail == null) {
tail = head;
}
size++;
}
public void addLast(Integer value)
{
ListNode newTail = new ListNode(value, null);
if (tail != null) {
tail. setNext(newTail);
tail = newTail;
} else {
head = tail = newTail;
}
size++;
}
public void addAtPos(int pos, Integer value)
{
if (pos == 0) {
addFirst(value);
return;
}
if (pos <= 0 || pos > size) {
return;
}
if (pos == size) {
addLast(value);
return;
}
ListNode ptr = head;
for(int i=0; i = size) {
return retVal;
}
if (pos == 0) {
return removeFirst();
}
ListNode ptr = head;
for(int i=0; i
ptr = ptr. getNext();
}
retVal = ptr. getNext().getValue();
if (pos == size-1) {
tail = ptr;
tail. setNext(null);
} else {
ptr. setNext(ptr. getNext().getNext());
}
size--;
return retVal;
}
public int findNode(Integer find)
{
ListNode ptr = head;
for(int pos=0; pos
if (ptr. getValue() == find) {
return pos;
}
ptr = ptr. getNext();
}
return -1;
}
public void rotate()
{
addLast(removeFirst());
}
public String toString()
{
String output = "";
ListNode iter = head;
while(iter != null) {
output += String. format("%d ", iter. getValue());
iter = iter. getNext();
}
return output;
}
}
size = 6 first = 50 last = 60
50 20 10 40 30 60
removeFirst = 50
size = 5 first = 20 last = 60
20 10 40 30 60
removed = 30
size = 4 first = 20 last = 60
20 10 40 60
size = 4 first = 20 last = 60
20 10 40 60
found at -1
removed = -1
size = 4 first = 20 last = 60
20 10 40 60
size = 4 first = 10 last = 20
10 40 60 20
Answers: 2
Computers and Technology, 21.06.2019 19:30
Keep your choice of a major there is probably no single correct choice.
Answers: 1
Computers and Technology, 22.06.2019 22:00
Researchers measured the data speeds for a particular smartphone carrier at 50 airports. the highest speed measured was 78.1 mbps. the complete list of 50 data speeds has a mean of x overbarequals16.11 mbps and a standard deviation of sequals18.65 mbps. a. what is the difference between carrier's highest data speed and the mean of all 50 data speeds? b. how many standard deviations is that [the difference found in part (a)]? c. convert the carrier's highest data speed to a z score. d. if we consider data speeds that convert to z scores between minus2 and 2 to be neither significantly low nor significantly high, is the carrier's highest data speed significant? a. the difference is nothing mbps.
Answers: 3
Computers and Technology, 23.06.2019 03:30
Many everyday occurrences can be represented as a binary bit. for example, a door is open or closed, the stove is on or off, and the fog is asleep or awake. could relationships be represented as a binary value? give example.
Answers: 1
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
Can someone urgently help me with my java code (I WILL GIVE BRAINLIEST)?! Ive been working on it for...
Chemistry, 27.10.2020 04:20
Geography, 27.10.2020 04:20
History, 27.10.2020 04:20
Mathematics, 27.10.2020 04:20
Mathematics, 27.10.2020 04:20
Computers and Technology, 27.10.2020 04:20
English, 27.10.2020 04:20
Mathematics, 27.10.2020 04:20
Mathematics, 27.10.2020 04:20
Biology, 27.10.2020 04:20