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

Answer 1

Answer:

code 345code 4537

Explanation:


Related Questions

libre office is what program​

Answers

I’m not 100% sure what this question is asking, but I believe the answer would be “an open-source office productivity software”.

20 POINTSS!! NEED HELP!!

Answers

Answer: You can start a new browser instance for each window you want to open

Explanation: HOPE THIS HELPED!!

Answer:

laat one

Explanation:

The average lease payment for a new vehicle is just over $450 per month for a three-year...

Answers

Answer:

it depends on your insurance company

Explanation:

ANSWER ASAP!!!!!!!


Which statement best describes licensed characters?
A.
They are based on real-life characters from past periods in history.
B.
They are given human qualities, and star in games for young children.
C.
They are based on preexisting media.
D.
They are based on legend and folklore.
E.
They are characters specifically created for a game.

Answers

I think the answer is B

They are given human qualities, and star in games for young children.

What are Human qualities?

Telling the truth, being direct with others, and being open-minded are all examples of being honest. Tell the truth, but never the unpleasant truth, as a very wise man once advised.

If someone has personal integrity, they will always endeavor to act morally even if no one will ever know what they did. They possess a strong sense of morality. Doing the right thing despite the repercussions requires courage.

Everyone can benefit from having integrity, but leaders especially need it.

Therefore, They are given human qualities, and star in games for young children.

To learn more about Human qualities, refer to the link:

https://brainly.com/question/983958

#SPJ2

Question 1 of 10
When you edit your slide by making sure that that first paragraph is right
justified, what are you correcting?
A. Hyperlinks that no longer work
B.Inappropriate content
C.Grammatical mistakes
D.Text alignment
B. Inappropriate content
C. Grammatical mistakes
D. Text alignment
SUBMIT

Answers

Text alignment is the answer

When you edit your slide by making sure that that first paragraph is right justified, here, one is correcting Text alignment. The correct option is D.

What is Text alignment?

Text alignment is a paragraph formatting attribute that determines how text appears throughout a paragraph.

For example, in a left-aligned paragraph (the most common alignment), text is aligned with the left margin. Text in a justified paragraph is aligned with both margins.

Alignment or range is the setting of text flow or image placement relative to a page, column, table cell, or tab in typesetting and page layout.

The type alignment option is also known as text alignment, text justification, or type justification.

Text alignment is corrected when you edit your slide by ensuring that the first paragraph is right justified.

Thus, the correct option is D.

For more details regarding text alignment, visit:

https://brainly.com/question/13423071

#SPJ7

There is one clear definition of IT. True False

Answers

Answer:

That is False. it has more definitions not only one.

Write a program using for loop to find the cube of numbers from 50-100

Answers

Answer and Explanation:

JAVA

for(int i = 50;  i <= 100          i++;)

{

    int cubedNum = Math.pow(i, 4);

    System.out.println(cubedNum);

}

what if the result of conectivity testing is 100%Loss?Explain.​

Answers

Answer:

If you have a 100% packet loss, it means that all packets get lost between certain hops on your connection. Which, in turn, renders you unable to reach the destination server

Examples and meaning of external hardware.​

Answers

Answer:

External hardware devices include monitors, keyboards, mice, printers, and scanners. external hardware devices are usually called peripherals.

5 examples of hardware?

Mouse, Keyboard, Monitor, Printer, USB, CD Drive, RAM, Hard Drive, Joystick, Scanner, DVD, CPU, Motherboard, Etc.

Explanation:

Hope this help have a good rest of your  day

PLS REPLY ASAP WILL MARK BRAINLIEST

Answers

Answer:

I replied ...?

Explanation:

He removed vertical borders, kept only vertical borders for the header and the totals. He also added shading to the rows.

how will you create new style in a spreadsheet? explain

Answers

To create a new style, open the table styles menu and select New style from the bottom. I'll name this new style "simple". Custom styles appear in the upper left of the Table styles menu. Excel will display the name when you hover over the thumbnail.

Q6.
A doctor's surgery provides medical care for people in the local area. The surgery uses Information
Technology to collect, store and process patient data.
Usernames and passwords are used to restrict user access to patient data.
Explain two other ways the surgery can restrict user access.

Answers

Fingerprint scanners, and padlocks

I need somebody to help me with this question I’ll give points!
Please help no funny business

Answers

Answer:

create a new folder (you need that in order to choose it as a destination)

click the rules button

new rule; blank rule

select forms and conditions

apply the rule to messages received

Complete the sentence.

involves placing a device on the network that captures all the raw data in the network traffic to try to find something valuable
A. Dumpster diving
B. Packet sniffing
C. Social engineering
D. Phishing

Answers

Answer:

D. Phishing

Explanation:

Answer: B. Packet sniffing

Explanation:

right on edge

What’s an input Device

Answers

Somthing that you plug in can I have brainlyist I just need one more :)

Answer:

._.  a computer is a input why because you can tell

Explanation:

Mention the usage of crop concept in ms-word​

Answers

Answer:

Every image editing software has a crop tool that allows you to trim or eliminate the edges of an image. Cropping tools in Ms.word allow you to hide portions of picture that you do not want to be displayed in the final result.

[tex]\huge\underline\mathbb\pink{ANSWER:}\\\\[/tex]

Every image editing software has a crop tool that allows you to trim or eliminate the edges of an image. Cropping tools in Word allow you to hide portions of pictures that you do not want to be displayed in the final result.

[tex]\\\\\\\\[/tex]

HOPE IT HELPS

PLEASE MARK ME BRAINLIEST ☺️

ANSWER ASAP!!!!!

Which statement is true regarding achievers?
A.
Achievers bring about a reduction in socializers.
B.
Achievers interact with the environment.
C.
Achievers cause grief to other players.
D.
Achievers like to interact with other players.
E.
Achievers like to collect points and earn rewards.

Answers

Answer:

The correct answer will be:

E. Achievers like to collect points and earn rewards.

Explanation:

where can i make an animation for free?

Answers

Answer:

I've heard of flipabook and apparently that's good for simple animations

Explanation:

Hope that helped! Have a nice day!

What are practical things people can do to protect their privacy and security online? What can we do, and what can we avoid doing?

Please help this is due today and I really need help.

Answers

there are multiple ways people can protect there privacy like you don’t even have to get online just block yourself away from the world or you can make sure that your always connected to a vpn with hides you from being online or you can avoid putting in your real information if it’s not needed

After inserting a video into your slide how can you test it

Answers

Explanation:

How to insert video into PowerPoint

Click on the slide you want, then go to Menu > Insert.In the top right corner, click Video > Video on My PC.Find the video you want to add and click “Insert”.Adjust the settings in the Video Format toolbar to make sure it plays the way you want.

Decrypt this message: P ht uva h zwf
It has been encrypted with a shift of 7 (remember each letter needs to go backwards.
uhhh pls help with this ill mark brainliest

Answers

translation: I am a spy

Which statement best describes fonts from a serif font family?
A.
These fonts have tapered corners and edges at the end of their strokes.
B.
These fonts have straight lines and uniform stroke widths.
C.
These fonts are cursive and italicized.
D.
These fonts have fixed widths.

Answers

Answer:

A

Explanation:

The main characteristic of a serif font is the tapered corners, so the answer would be A.

Answer:

A. These fonts have tapered corners and edges at the end of their strokes.

Explanation:

just did the test this is the answer, hope I helped :)

Successful businesses must have managers who are able to complete each of the management functions well. True False

Answers

Answer:

I think that is true.

ANSWER ASAP!!!!!!!

Which variable captures the fact that a person is spontaneous or flexible?
A.
senses
B.
judgment
C.
perceptiveness
D.
feeling
E.
intuition

Answers

it is c) perceptiveness

Answer:

C - perceptiveness

Explanation:

PLATO

........... Is ready made button for defining hyperlink on a slide​

Answers

Action Buttons An action button is a ready-made button that you can insert into your presentation and define hyperlinks. Use action buttons when you want to include buttons with commonly understood symbols for going to the next, previous, first, and last slides.

Complete the sentence.
One way to increase the reliability of a hard disk drive is by making it part of ____
an optical array
a capacitator
a RAID
an analog ray

Answers

I think it is the capacitor

Answer: It is raid

Explanation:

Took the test for edge

list any four e-commerce website​

Answers

Answer:

Amazon. Founded in the US in 1994, Amazon started as an online bookstore that later diversified to products including media, electronics, apparel, furniture, food, toys, and jewelry.

eBay. ...

Walmart. ...

Etsy. ...

Home Depot. ...

Target. ...

Best Buy. ...

Wayfair.

Answer:

I'm sorry is this a question?

how can i help?

Explanation:

When using e-mail for business purposes, employees should _____.


be brief

use spell check

use appropriate punctuation

write in all capital letters when the message is important

use correct grammar

send out jokes to increase employee morale

proofread messages

use extra exclamation marks to indicate urgency

Answers

Answer:use spell check

proofread messages

use appropriate punctuation

be brief

use correct grammar

Explanation:

The most effective leaders treat everyone alike. True True False

Answers

Answer:

you have to have evidence they do that and on the question theirs no evidence so the answer would be false (as long as theirs no evidence)

Explanation:

Answer:

True

Explanation:

What is the most important function of a network operating system (NOS)?

Answers

Answer:

One of the most important functions of a network operating system is its ability to share resources with other network users. The most common resource that's shared is the server's file system.

Explanation:

One of the most important functions of a network operating system is its ability to share resources with other network users. The most common resource that's shared is the server's file system.

What is network operating system?

An operating system for computers known as a "network operating system" (NOS) is primarily made to handle workstations, personal computers, and occasionally older terminals that are linked together over a local area network (LAN).

A NOS's supporting software enables resource sharing and communication amongst various networked devices. A NOS's usual hardware configuration consists of several personal computers, a printer, a server, and file servers that are linked by a local network.

Because earlier iterations of the fundamental operating system weren't created with network use in mind, network operating systems

Therefore, One of the most important functions of a network operating system is its ability to share resources with other network users. The most common resource that's shared is the server's file system.

To learn more about network operating system, refer to the link:

https://brainly.com/question/28356173

#SPJ2

Other Questions
Luke starts to get the idea that he should visit the potential third child at the Sports Familys house. Why does he feel compelled to leave sooner than later? Y 9. . ~^_ A. XYT; YZT B. XTY; YTZ C. TXY, ZYT Z T D. YXT; TYZ easy question......... I will gicve you 80 points if answered correctly Please help me I need these answers Nine more than the quotient of a number and 5 is -22 Which is NOT true of magneticdomains?A. Magnetic domains are groups of alignedatoms.B. Magnetic domains are too small to be seen.C. Magnetic domains are outside of a magnet. High-speed winds transfer more energy to the oceans surface, creating bigger waves.Question 10 options: True False Why is it important to include a conclusion at the end of an argument? to answer a question to restate the claim to introduce an idea to show understanding Factorise m2 - 10m + 24 =0 Julie weighs five watermelons and rounds the weighs to the nearest hundredth which of the weights round to 7.43 pounds Please help me find all the missing angles Write two paragraphs about this please Ill give brainliest :((Do you feel that the first ten amendments of the United States still play a key role in our society today? Lately we have been discussing the debates between Jefferson and Hamilton over multiple things including the government's role in protecting individual rights. Today, some people believe certain rights should be protected by law while others should not. Explain why, or why not, we should still depend on the Constitution and the Bill of Rights the lead our government. Feel free to look up the Bill of Rights if you cannot remember. solve for x: 3^(x+3)=9 Which represents the inverse of the function f(x) = 4x?h(x) = X + 4h(x) = x-4h(x) = 3/4xh(x) = 1/4x Whos figure is correct, Ben or Lucy? Who watches Riverdale ? if you do can we be friends(pLEASE DON'T DELETE) and also who is your fav character from Riverdale How do I hide apps on my MacBook or disguse it as other apps? ples help find the slopes in this image Overall, the passage can best be interpreted as an account of a a) terrifying ordealb) daring rescue c) personal triumphd) spiritual crisis e) transcendent experience