The remove() method in the Queue interface ________. Group of answer choices retrieves, but does not remove, the head of this queue, returning null if this queue is empty retrieves and removes the head of this queue, or null if this queue is empty retrieves, but does not remove, the head of this queue, throwing an exception if this queue is empty retrieves and removes the head of this queue and throws an exception if this queue is empty

Answers

Answer 1
Question:

The remove() method in the Queue interface ________.

A. retrieves, but does not remove, the head of this queue, returning null if this queue is empty

B. retrieves and removes the head of this queue, or null if this queue is empty

 

C. retrieves, but does not remove, the head of this queue, throwing an exception if this queue is empty

D. retrieves and removes the head of this queue and throws an exception if this queue is empty

Answer:

D. retrieves and removes the head of this queue and throws an exception if this queue is empty

Explanation:

In Java, the Queue interface is found in the java.util package and inherits from the Collection interface. It is used to store elements which are processed in the order in which they are inserted. This means that the first element will be processed first.

The Queue interface has many methods. Some of them are;

i. add(): allows elements to be added to the queue.

ii. remove(): retrieves and removes elements from the head of the queue. The head of the queue points to the first element of the queue. If the queue is empty, the remove() method throws an exception called the NoSuchElementException

iii. poll(): retrieves and removes the element at the head of the queue. Unlike the remove() method, if the queue is empty, a null is returned.

iv. peek(): retrieves but does not remove the element at the head of the queue. Just like the poll() method, a null is returned if the queue is empty.


Related Questions

Which is an example of a table style option?

O banded columns

O shading

O borders

O pen color

PLEASE HELP ASAP

Answers

Which is an example of a table style option?

O banded columns

[tex]\large\mathfrak{{\pmb{\underline{\orange{Mystique35 }}{\orange{❦}}}}}[/tex]

The cultivation in mountain areas, with their scattered plots of usable land at various altitudes with different climates, landscapes and little margin for mechanization, are managed by family farms in the most efficient and effective way.

Answers

Answer:

Mountain farming

Explanation:

Mountain farming is done in hilly areas of the mountains. It is mainly family farming. The mountain farming is mainly done in the mountains where the paddy fields are scattered and the limited use of the usable lands are available.

It is cultivated in different types of climatic conditions or landscapes with limited use of mechanization or machines. The mountain farming is maintained by the family farms in an effective way.

it is used to hold screws, jumpers, fasteners, and other small parts and prevent them from getting mixed together​

Answers

Answer:

Cable ties

Explanation:

Used to bundle cables neatly inside and outside of a computer. It is used to hold screws, jumpers, fasteners, and other small parts and prevent them from getting mixed together.

>3

[tex]\boxed{Parts\: organizer}[/tex] is used to hold screws, jumpers, fasteners, and other small parts and prevent them from getting mixed together.

[tex]\bold{ \green{ \star{ \orange{Mystique35}}}}⋆[/tex]

A Python keyword ______________.

can be user defined

cannot be used outside of its intended purpose

can only be used in the comments section

can be used anywhere in a Python program

Answers

Answer:

cannot be used outside of its intended purpose.

Explanation:

In many programming languages, keywords are special and reserved words that are used for specific and specified purposes. They have special meanings and cannot be used outside their intended purposes.

Keywords cannot be used as variable names, identifiers or functions.

In Python, some of such keywords include;

i. True

ii. False

iii. for

iv. while

v. break

vi. continue

vii. if

viii. else

ix. def

x. pass

Name the function for output in python.

Answers

Answer:

We use the print() function to output data to the standard output device (screen). We can also output data to a file, but this will be discussed later. An example of its use is given below.

Answer:print()

Explanation:As said above. Print is what we use in python (:

write a program to enter RADIUS of a CIRCLE and PRINT AREA of TRIANGLE using Q Basic. (class 8)​

Answers

Answer:

The program is as follows:

10 INPUT RADIUS, BASE, HEIGHT

20 CIRCLE = 3.142* RADIUS * RADIUS

30 TRIANGLE = 0.5* BASE * HEIGHT

40 PRINT CIRCLE

50 PRINT TRIANGLE

60 STOP

Explanation:

The program description doesn't tally;

In other words, it is impossible to calculate the area of a triangle using the radius of a circle.

So, I designed the program to get input for radius, base and height.

Get input for radius, base and height

10 INPUT RADIUS, BASE, HEIGHT

Calculate area of circle

20 CIRCLE = 3.142* RADIUS * RADIUS

Calculate area of triangle

30 TRIANGLE = 0.5* BASE * HEIGHT

Print area of circle

40 PRINT CIRCLE

Print area of triangle

50 PRINT TRIANGLE

End of program

60 STOP

explain why the computer is powerful working tool???​

Answers

Answer:

here ya go

Explanation:

A computer is a powerful tool because it is able to perform the information processing cycle operations (input, process, output, and storage) with amazing speed, reliability, and accuracy; store huge amounts of data and information; and communicate with other computers.

You provide desktop support for a small company. The company has two locations in the same city, but they are several miles away. You get a call from a user who is having problems installing a new device. You try to tell the user how to update the driver for the device over the phone, but he is having a hard time understanding your directions and is becoming frustrated.
What should you do?
A. Tell the user to wait until you are scheduled to be in that location.
B. Escalate the call to another technician or your supervisor.
C. Drive to the other location as soon as possible and update the driver.
D. Establish a Remote Desktop connection and update the driver.

Answers

Answer:

The answer is "Option D".

Explanation:

It is a desktop platform that helps a "client" computer can join from a remote location to a "host" computer. Clients can then manage and then use apps and files anywhere on network protocols.

This technology enables users to link from the remote location to a specific machine as if they were sitting beside it. Once this connection is established, users can carry out a variety of tasks as if they actually use the computer directly.

Investigate the many ways that hardware and software can cause an interrupt to occur. Are ALL interrupts treated equally or do some have priority over others?​

Answers

Answer:

Following are the responses to the given question:  

Explanation:

This list is based mostly on the processor. Then you'll be ordered. An interrupt of a particular cable (wire) is produced for PC-ish CPUs (IRQ 0 - 31 for some intel processors). The bigger challenge is a lower number.

Strange factors have included a system clock, power business, 0, some reserved for use by CPU testing, serial/parallel/... ports and also some terminated/error/state/new devices requests device Thus a key touch on the keyboards could create an interrupt that was direct on old devices.

To prevent certain columns from being displayed when printing a worksheet, _______ the columns.

erase
hide
highlight
remove

Answers

Hide I believe!!!!!!
To prevent certain columns from being displayed when printing a worksheet, HIDE the columns.

True or False: Microsoft Publisher allows you to click and drag an element anywhere on the page.

Answers

Answer:

True

Explanation:

can you plz answer me from the photo​

Answers

A. True
B. False
C. True

The size (number of bytes) of a structure-type variable can be changed by the following factors. Select all that apply. Group of answer choices changing the orders of the members in the structure. adding a member into the structure. changing an int-type variable to a pointer-type variable. changing the computer from a 32-bit to a 64-bit processor.

Answers

Answer:

A, B, and D

Explanation:

Considering the available options, the size (number of bytes) of a structure-type variable can be changed by the following factors:

A. changing the orders of the members in the structure.

B. adding a member into the structure.

D. changing the computer from a 32-bit to a 64-bit processor.

_________________________ are people, places, and materials, either printed or non-printed, that can provide answers to inquiries.

Answers

Answer:

Information/knowledge resources

Explanation:

The process of looking for answers to questions that will lead to improved knowledge about a subject is known as an inquiry. The theories of enquiry includes abduction, induction, and deduction

An inquiry can provide the reasoning behind observation by making use of the theories of inquiry and sources that provide answers (information) about the (interrelated) events of the inquiry

Therefore, information and knowledge resources are the people, materials, and places, which can be in the printed, verbal, appearance form that have the capacity to proffer answers to inquiries

I copied my friend's homework... give me some excuses to get out of it!! ​

Answers

Answer:

Tell the teacher that you will pee in her coffee cup if they don't forget about what you did

Explanation:

Answer:

Explanation:

Depends on the homework, but

"We worked together on it and came to similar conclusions."

"We checked answers with each other when we finished to make sure we got the problems correct and did the problems correctly."

17.35 ma of current is flowing though a brown-red-brown resistor,what is v

Answers

Answer:

2.1V

Explanation:

brown-red-brown = 120Ω

V = I·R = 17.35 · 120 = 2.082V

However, the tolerance of the resistor is at least 10%, so you can't express the voltage that accurate.

A current divider is to be designed using a 2mA DC current source and 1K resistors, the specification that the current is 1.5mA.

Answers

Answer:

The solution of the given query is described below throughout the explanation segment.

Explanation:

Given:

DC current,

= 2mA

Resistors,

= 1K

According to the question,

⇒ [tex]i=\frac{(1K+1K+1K)\times 2mA}{1K+1K+1K+1K}[/tex]

⇒   [tex]= \frac{3}{4}\times2mA[/tex]

⇒   [tex]=1.5mA[/tex]  

how is a trade off best described ?

dilema
compromise
demand
complication

Answers

I think the answer is compromise <3

State two pieces of information that need to be labeled on the idea development sketch. 1 .________________________________________________. 2 .___________________________________________.​

Answers

Answer:

Design drawings should show details on layout, measurements, plan, cross-sectional and vertical profiles. This information is prepared as scale drawings of the works to be constructed. they are legible  they include all information from previous revisions and updates.

Explanation:

help,any question answer​

Answers

Answer:

true

false

true

true

Explanation:

I took the paper

A customer in a store is purchasing five items. Write a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7 percent. Display all results, properly labeled, as numbers with two digits after the decimal point.

Answers

Answer:

Program approach:-

Using the header file.Using the standard namespace I/O.Define the main function.Display the enter price of 5 terms.

Explanation:

Program:-

//header file

#include<iostream>

#include<iomanip>

//using namespace

using namespace std;

//main function

int main(){

       const double SALES_TAX=0.07;

       double subTotal=0,total=0,taxAmount = 0,x;

       

       cout<<"Enter price of 5 items"<<endl;

       for(int j=0;j<5;j++){

               cin>>x;

               subTotal += x;

       }

       taxAmount = subTotal * SALES_TAX;

       total = taxAmount + subTotal;

       cout<<fixed<<setprecision(2)<<endl;

       cout<<"Sub total: "<<subTotal<<endl;

       cout<<"Sales Tax: "<<taxAmount<<endl;

       cout<<"Total: "<<total<<endl;

       

       

}

how to prevent water pollution​

Answers

Answer:

Here is your answer

Explanation:

1. pick up litter and throw it away in a garbage can.

2. use environmentally household products such as washing powder, household cleaning agents

3. wash your car or outdoor equipment where it can flow to a gravel or grassed area instead of a street.

4. don't throw waste at ocean it will harm the animals and create tocsin.

For what purpose do the hackers create the zombies army?

A. DDoS Attacks
B. DoS Attacks
C. Warm Attacks

Answers

Answer:

A. DDoS Attacks

Explanation:

A zombie, in computer terminology, is a hacker, computer worm, trojan horse, or virus compromised internet connected computer, which can be remotely directed to perform malicious tasks

E-mail spams and denial-of-service, DoS attacks are spread and launched by botnets of zombie computers

Botnets which are also known as "zombie army", are used by hackers mainly for spam and distributed-denial-of-service, DDoS, attacks

While a DoS attack involves one machine, while a DDoS attack consist of multiple computing devices and machines

A botherder is the originator of a botnet and common botnets include Mr Black. Pushdo, and cyclone

A small business utilizes a SOHO router and wishes to secure its existing wireless infrastructure. The business has fewer than ten devices, which are a mixture of old and new machines. Due to the varying ages of the machines, the latest wireless encryption methods may not be supported on all devices. Which of the following would be the MOST cost-effective method to add a layer of security while allowing all machines to connect?
A. MAC filtering
B. 802.1X
C. WPA2
D. EAP-FAST

Answers

Answer:

C

Explanation:

WPA2 builds on its predecessor, WPA, and is specifically designed to meet the most demanding enterprise security needs. ... Furthermore, because WPA2 is backwards- compatible with WPA, organizations that have already implemented the WPA standard can migrate to WPA2 at their own pace.

What are the uses of DVD Ram​

Answers

Answer:

Like ordinary random access memory (RAM), it can be repeatedly read, written to, and erased. Intended mostly for removable computer storage, DVD-RAM provides the capabilities of Rewriteable CD (CD-RW) - users can run programs from the discs, copy files to them and rewrite or delete them.

DVD Ram Like ordinary random access memory (RAM), it can be repeatedly read, written to, and erased. Intended mostly for removable computer storage, DVD-RAM provides the capabilities of Rewriteable CD (CD-RW) - users can run programs from the discs, copy files to them and rewrite or delete them.

What is Adobe Dreamweaver ? What is it used for ? Name and describe its major components and features in detail​

Answers

Answer:

Part A

Adobe Dreamweaver is a computer application used for building websites and other types of web development, as well as mobile content development for both the intranet and the internet, on the Apple OS X and Windows Operating System Platforms

Part B

Adobe Dreamweaver is used for designing, building, and coding websites and mobile contents by developers and designers and by mobile content developers

Part C

i) Adobe Dreamweaver allows rapid flexible development of websites

The simplified engine on which Adobe Dreamweaver is based makes it easy to adapt web standards including CSS, and HTML for personalized web projects, thereby aiding learning of the web standards and fast (timely) web development

ii) The time between starting development and deployment is shorter when using Adobe Dreamweaver due to the availability of customizable templates that serve wide range of user web interfaces, including e-commerce pages, newsletters, emails and blogs

iii) Building of websites that adapts to the screen size of the device from where the site is accessed is possible with Adobe Dreamweaver

Explanation:

benefits of Internet as method of information transmission​

Answers

Answer:

The Internet enables effective global communication around the world and has changed the way people socialize and consume media via social networks, and has facilitated teleworking, distance learning and e-learning. The Internet has given rise to new e-commerce companies and industries, and knocked out other traditional players, but also contributed to the development of the IT bubble and burst at the turn of the millennium. To counter piracy of music and movies over the internet, new streaming services have been developed since the 00's and cut out distribution lines. Web magazines and social media have competed with many traditional media, especially the local press, and reduced the labor market for journalists. Social media may have been a tool (but not a catalyst) for revolutions such as the Arab Spring and of significance for an explosive increase in the spread of fake news and misinformation since the 2000s. Social media is believed to have had an impact on election results, but it is debatable whether fake news has had it.

What is a benefit of using a client/server network?
Cheap to maintain
Easy to install
Has a central, powerful computer
Unable to share files

Answers

Answer:

Has a central powerful computer

Explanation:

When operating a client - server network, a certain access mediun is created such that clients can access information, materials and services from a central computer, this poses great advantage in the area of security and control. Clients would be able to gain access from this central computer using either a local or wide area network. The accessibility provided through this powerful, central computer allows the the network to monitor what actions are being performed and make appropriate restrictions on the network, hence, preventing the invasion of malware and viruses. Hence, the central control is a great feature of a client - server network.

what is the basic unit of measuring storage capacity of computer?​

Answers

Answer:

All data are stored on 1s and 0s computers (bits). We explain how much data we store using conditions such as kilobytes and megabytes.

Explanation:

Storage devices

All are stored in 1s and 0s on a computer. One of only 1 0 is called 'bit' in a computer. It takes 8 1s and 0s if we save a character in a computer, so we could say it needs 8 bits to store a character.

Computer and memory storage is frequently measured in megabytes and gigabytes (GB). A medium-sized novel includes approximately 1 MB of information. One MB is 1024 kilobytes, not a million bytes, or 1,048,576 bytes (1024x1024).

Similarly 1 GB is 1.024 MB (1024x1024x1024) bytes, or 1.073.741.824 bytes.

write an algorithm to find perimeter of circle​

Answers

It is usually called the circumference of a circle, not a perimeter.

For a circle with radius r, the formula for the circumference C is

=2

Answer:

Explanation:

Algorithm:

step 1 : Start

step 2 : Read r

step 3 : POC = 2*22/7 *r                   POC = perimeter of circle

step 4 : display POC

step 5 : Stop

Other Questions
13. In lines 15-16, the phrase "The wagon turned and crawled out the entrance road" is anexample of personification. What is the impact of using this method? According to Montesquieu, what would happenabsolute monarchy? a number is 2 more than 3 times the other number if the is 26 then the number are I need help about newton law The defendant is charged with the battery of a bouncer at a local tavern. At the trial, the prosecutor introduces evidence that while the bouncer was attempting to question the defendant about her intoxicated demeanor, the defendant committed a battery on the bouncer. The defendant attempts to defend against the charge on the basis of self-defense, insisting that the bouncer used excessive force in stopping her from entering the tavern. The defendant attempts to introduce into evidence an authenticated copy of the tavern records that show that three patrons had written complaints against the bouncer within the past six months for the use of excessive force. The prosecutor objects on the grounds that the records are inadmissible character evidence.Should the court sustain the objection?A. Yes, because the character of a victim can be established only by reputation or opinion evidence.B. Yes, because there is no evidence that the incidents involving the three patrons were based on the same facts as the defendant's claim.C. No, because the records were authenticated.D. No, because the character trait of a victim may be established by opinion evidence, reputation evidence, or specific acts of misconduct. when should i use the verb conocer? Can someone do this Write a brief description for the given terms 1. Gravity 2. Friction 3. Difference between mass and weight 4. Free fall Choose the letter of the correct answer. Write the chosen letter on a separate sheet of paper.1. What is the principal root of 49 ?A. 7 B. 7 C. 14 D. 28 2. The following gives a rational root except __________.A. 116B. 34C. 1273 D. 16 43. How would you classify the value of 160 ?A. Fraction B. Integers C. Irrational D. Rational4. The value of 85 can be found in between, which of the following consecutive integers?A. 8 & 9 B. 9 & 10 C. 10 & 11 D. 11 & 125. Which of the following numbers can we find in between the two consecutive integers, 13 & 14?A. 90 B. 130 C. 180 D. 900 Bryan and Ryan are buying a car that costs 15000. Bryan pays a deposit of 2000 Ryan pays a deposit that is 40% more than Bryans deposit. Work out the percentage of the total cost that is left to pay? I have read it for myself. The bible (in genesis) states that the earth will be here forever. This directly conflicts with everything we know about the universe. I am very confused. could someone explain? The Lowell Textile Mills excerpt and the Investigation of Labor Conditions, 1845 excerpt have the same _________, but different_________. Can you solve this problem Susan buys the items listed below at a grocery store. 2 packages of chicken priced at $13.26 per package 1/2 pound of broccoli priced at $ 1.88 per pound 1 gallon of milk priced at $3.49 per gallon There is no sales tax on the food she buys. Susan pays for the items and receives $ 0.05 in change. What amount of money does Susan use to pay for the items? Gerald is thinking of a number n, and he wants his sister to guess the number. His first clue is that 7 more than 3 times hisnumber is at least 10 and at most 28. Write a compound inequality that shows the range of numbers that Isabella might bethinking of.Write your answer in interval notation. For example-3 Answer the following: a) 2x32 =b) (2 x 3)2 = "I've been researching Alzheimers disease for decades," the doctor said, but I still have so many unanswered questions."a. been researchingb. Alzheimersc. said, butd. No error 1. Create a word problem that involves solving inequalities using addition and subtraction.2. Solve the word problem you created. Show your work Which one is it ?! (Hurry) What is the mean? If the answer is a decimal, round it to the nearest tenth.-4 1 4 -14 -1 -2 -6 3-5-8