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
Mademuasel [1]
3 years ago
14

Module 6 Assignment: This assignment is an individual assignment. 1. (20 pts) What would happen if you execute the following cod

e just before traversing a linked list? head.setNext(head); 2. (20 pts) The linked list that follows represents a queue. If we dequeue once, what item is dequeued? (7, Ajay, NFL)(3, Sarah, Mario)(9, Jim, Golf)head (5, Joe, Sonic)null tail 3. (20 pts) The linked list that follows represents a stack. After we push the player (5,Joe,Sonic) onto the stack, what are the first and last items on the stack? (7, Ajay, NFL)(3, Sarah, Mario)(9, Jim, Golf)null head 4. (40 pts) What is the advantage of linked lists over arrays? Note:
Computers and Technology
1 answer:
mariarad [96]3 years ago
4 0

Answer:

Check the explanation

Explanation:

1) It is expected to produce a loop which repeatedly points head node and other nodes in the list will be dead links as it can't be reachable.

2) When you dequee first element will have removed. That is 7, Ajay, NFL.

3) When you push an element, it will be added at the beginning. So first item would be new item that is 5,joe, sonic. Last item don't change it would be same 9,jim,Golf.

4)

1) Arrays are continuous. If you need to store 1000 elements and there are no 1000 continuous memory locations, then program will fails. But if memory contains sparsed 1000 locations, we can use linked list.

2) Insert, delete are faster in linked list than Array.

You might be interested in
Differentiate among a color display, gray scale display, and a black-and-white display​
kotykmax [81]

<u>Answer:</u>

<em>Black and white</em>:

It has only two values namely black or white. The white colour in the image will be represented as “white” and other colour part will be displayed as black.

<em>Grey-scale: </em>

Again the white part does not have a change, the black and other coloured items will be displayed in grey.

<em>Coloured image: </em>

It would display the actual colour of the image. The number of colours and shades depends on the original image from where actually it has been shooted and it also depends on the quality of the camera.

4 0
3 years ago
One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input
salantis [7]

Answer:

import java.util.Scanner;

public class Miles {

public static void main(String[] args) {

   //initialization

       double Number_Miles;

       //print the message

       System.out.print("Enter the number of miles: ");

       Scanner scn1 = new Scanner(System.in);

       

       Number_Miles = scn1.nextDouble();  //read the input from user

       //calculate the laps

       double yourValue = Number_Miles/0.25;

       //display the output on the screen

       System.out.printf("%.2f", yourValue);

     

}

}  

Explanation:

First import the library Scanner than create the class and define the main function. In the main function, declare the variables.

print the message on the screen and then store the value enter by the user into the variable.

Scanner is a class that is used for reading the output. So, we make the object of the class Scanner and then object call the function nextDouble() which reads the input and store in the variable.

After that, calculate the number of laps by dividing the number of miles with the given one lap running track value (0.25 miles).

Number\,of\,laps = \frac{Number\,of\,miles}{0.25}

the output is stored in the variable.

After that, print the value on the screen with 2 digits after the decimal point.

we can use "%.2f" in the printing function in java.

like System.out.printf("%.2f", output);

5 0
3 years ago
Read 2 more answers
[5]Suppose a 1,600 kg car is traveling at 20.0 m/s. What average force is needed to stop the car in 4.0 s?
SVEN [57.7K]
This is in the wrong caterigore and yes the answer is 8.0 × 103 N 
5 0
3 years ago
Read 2 more answers
Which search strategy is most similar to greedy search?
lesya692 [45]

Answer:

I think the answer would be A.

Explanation:

If I'm wrong plz let me know (I think I may be wrong)

8 0
3 years ago
Sarah is a busy real estate agent with a growing clientele. She is looking to purchase a new computer and software so that she c
lyudmila [28]

Answer:

ASP.NET ,C#.NET,SQLServer,HTML,JavaScript

Explanation:

To build any web based application we need one presentation layer(HTML)

and for client side scripting JavaScript.

ServerSide ASP.NET Technology  and C#.NET to write your business layer

Sql programming to store data in sql server

5 0
3 years ago
Other questions:
  • What identifies available computers through the internet?
    14·1 answer
  • Oxygen-18 has an atomic number of 8. How many neutrons are in this isotope?
    7·1 answer
  • .true or false? one disadvantage of cloudware is that it is never free<br> A. true<br> B. false
    12·1 answer
  • ___signs tell you what you can or can't do, and what you must do ?
    5·2 answers
  • Copy the skeleton of code below into your answer. Then in the space indicated, add your own code to prompt the user for two numb
    8·1 answer
  • Which term describes a visual object such as a picture, a table, or a text box?
    14·2 answers
  • क) मानौं तिमी बसेको समाजमा मान्छेहरूले सधै फोहर फाल्ने गर्नाले वातावरण प्रदूषित
    13·1 answer
  • 8.11 LAB: Count characters - functions Write a program whose input is a character and a string, and whose output indicates the n
    6·1 answer
  • If 209g of ethanol are used up in a combustion process, calculator the volume of oxygen used for the combustion at stp​
    5·1 answer
  • How to make your nest learning thermostat stop doing something
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!