1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Natasha_Volkova [10]
3 years ago
12

The ________________ operation is required by the Iterable interface.

Computers and Technology
1 answer:
masya89 [10]3 years ago
3 0

Answer:

For question one, the first line  It is Iteration, The second line is Comparator, the third line is none of these is correct.

Question two, the index based method  for (a) is O(1) (b) O(1) (c) O(N) (d) O(N)

Explanation:

<em>Solution to the question</em>

Question 1:

The Iteration operation is required by the Iterable interface.

n application can indicate a specific way to order the elements of a SortedABList list by passing a(n) Comparator so that we can customize the sorting object to a constructor of the list class.

Suppose a list names contains 8 elements. A call to names.add(0, "Albert") results in:  (e) None of these is correct

Question 2:

let us assume that the LBList is built on top of a Linked List and the ABList is built on top of an array:

(a) the add method index based  is O(1) in the average case  and  the O(N) in the worst case

(b) The Index based set operation is O(1) since we can simply move to any index of an array of time constant.

(c) It is O(N) since index Of method needs to look for  the whole array (based on worst case  or average) to get the index

(d)  It is O(N) since index Of method needs to find the whole linked list (on worst case or average ) to search  the index.

You might be interested in
Which statement correctly describes the difference between an IP address and a MAC address for a
Citrus2011 [14]

The statement that correctly describes the difference between an IP address and a MAC address for a  specific device is that the IP address can change, but the MAC address always stays the same.

For better understanding, let us explain what the  IP address and a MAC address means

  • IP address simply mean Internet protocol address , it is a distinct string of numbers that is often separated by full stops that shows each computer using the Internet Protocol to link or communicate over a network.
  • MAC address is simply regarded as a A distinct number also as it shows a device or computer that is linked or connected to the internet.
  • One of the major difference between a MAC address and an IP address? is that the IP address gives the location of a device on the internet but the Mac address identifies the device connected to the internet.  

from the above, we can therefore say that the answer The statement that correctly describes the difference between an IP address and a MAC address for a  specific device is that the IP address can change, but the MAC address always stays the same, is correct

learn more about  IP address and a MAC address  from:

brainly.com/question/6839231

5 0
2 years ago
The programming interface between an application program and the dbms is usually provided by the
Inessa05 [86]
The Data Access API.
8 0
2 years ago
Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "To
SVETLANKA909090 [29]

Answer:

<h2>Function 1:</h2>

#include <stdio.h> //for using input output functions

// start of the function PrintPopcornTime body having integer variable //bagOunces as parameter

void PrintPopcornTime(int bagOunces){

if (bagOunces < 3){ //if value of bagOunces is less than 3

 printf("Too small"); //displays Too small message in output

 printf("\n"); } //prints a new line

//the following else if part will execute when the above IF condition evaluates to //false and the value of bagOunces is greater than 10

else if (bagOunces > 10){

    printf("Too large"); //displays the message:  Too large in output

    printf("\n"); //prints a new line }

/*the following else  part will execute when the above If and else if conditions evaluate to false and the value of bagOunces is neither less than 3 nor greater than 10 */

else {

/* The following three commented statements can be used to store the value of bagOunces * 6 into result variable and then print statement to print the value of result. The other option is to use one print statement printf("%d",bagOunces * 6) instead */

    //int result;

    //result = bagOunces * 6;

    //printf("%d",result);

 printf("%d",bagOunces * 6);  /multiplies value of bagOunces  to 6

 printf(" seconds");

// seconds is followed with the value of bagOunces * 6

 printf("\n"); }} //prints a new line

int main(){ //start of main() function body

int userOunces; //declares integer variable userOunces

scanf("%d", &userOunces); //reads input value of userOunces

PrintPopcornTime(userOunces);

//calls PrintPopcornTime function passing the value in userOunces

return 0; }

Explanation:

<h2>Function 2:  </h2>

#include <stdio.h> //header file to use input output functions

// start of the function PrintShampooInstructions body having integer variable numCycles as parameter

void PrintShampooInstructions(int numCycles){

if(numCycles < 1){

//if conditions checks value of numCycles is less than 1 or not

printf("Too few."); //prints Too few in output if the above condition is true

printf("\n"); } //prints a new line

//else if part is executed when the if condition is false and else if  checks //value of numCycles is greater than 4 or not

else if(numCycles > 4){

//prints Too many in output if the above condition is true

printf("Too many.");

printf("\n"); } //prints a new line

//else part is executed when the if and else if conditions are false

else{

//prints "N: Lather and rinse." numCycles times, where N is the cycle //number, followed by Done

for(int N = 1; N <= numCycles; N++){

printf("%d",N);

printf(": Lather and rinse. \n");}

printf("Done.");

printf("\n");} }

int main() //start of the main() function body

{    int userCycles; //declares integer variable userCycles

   scanf("%d", &userCycles); //reads the input value into userCycles

   PrintShampooInstructions(userCycles);

//calls PrintShampooInstructions function passing the value in userCycles

   return 0;}

I will explain the for loop used in PrintShampooInstructions() function. The loop has a variableN  which is initialized to 1. The loop checks if the value of N is less than or equal to the value of numCycles. Lets say the value of numCycles = 2. So the condition evaluates to true as N<numCycles  which means 1<2. So the program control enters the body of loop. The loop body has following statements. printf("%d",N); prints the value of N followed by

printf(": Lather and rinse. \n"); which is followed by printf("Done.");

So at first iteration:

printf("%d",N); prints 1 as the value of N is 1

printf(": Lather and rinse. \n");  prints : Lather and rinse and prints a new line \n.

As a whole this line is printed on the screen:

1: Lather and rinse.

Then the value of N is incremented by 1. So N becomes 2 i.e. N = 2.

Now at second iteration:

The loop checks if the value of N is less than or equal to the value of numCycles. We know that the value of numCycles = 2. So the condition evaluates to true as N<numCycles  which means 2=2. So the program control enters the body of loop.

printf("Done."); prints Done after the above two lines.

printf("%d",N); prints 2 as the value of N is 2

printf(": Lather and rinse. \n");  prints : Lather and rinse and prints a new line \n.

As a whole this line is printed on the screen:

2: Lather and rinse.

Then the value of N is incremented by 1. So N becomes 2 i.e. N = 3.

The loop again checks if the value of N is less than or equal to the value of numCycles. We know that the value of numCycles = 2. So the condition evaluates to false as N<numCycles  which means 3>2. So the loop breaks.

Now the next statement is:

printf("Done."); which prints Done on the screen.

So as a whole the following output is displayed on the screen:

1: Lather and rinse.

2: Lather and rinse.

Done.

The programs along with their outputs are attached.

6 0
2 years ago
Which education and qualifications are most helpful for Law Enforcement Services careers? Check all that apply.
bixtya [17]

Explanation:

For IAS..we need a high amptual amount of knowledge..

For IPS..we need master degree and physical fitness too..

For An Advocate..we need Master degree and social Skills..

so..the education and qualifications depends on the various jobs..

HOPE THE ANSWER IS USEFUL

3 0
2 years ago
When would a one way flag variable be used
Tamiku [17]
A one-way flag<span> can also be </span>used<span>, for example, to watch errors occuring in input data so that the program </span>could<span> ask the inputs again. A </span>variable<span> is a temporary if its value is always needed only for a very short period.</span>
7 0
3 years ago
Other questions:
  • Write a function getPigLatin(pigStr) that accepts pigStr as a parameter (a sentence as input) and converts each word to "Pig Lat
    8·1 answer
  • The most common types of utility programs fall into these categories. accessibility calculation communication data entry enterta
    6·2 answers
  • An IT technician has manually configured an IP address on a laptop for a new employee. Each time the employee tries to connect t
    10·1 answer
  • How does a router differ from such devices as repeaters, bridges, and switches?
    6·1 answer
  • Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An ho
    12·1 answer
  • Which key should you press and hold to select multiple cells?
    8·2 answers
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • Advanced Electronics has employees who use a company website to share work. By posting on the website, employees are
    7·1 answer
  • Which job role requires you to create user guides for computer products and services?
    11·1 answer
  • Is a free verse a poetry that has no images
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!