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
galben [10]
3 years ago
14

Consider the following code which deletes all the nodes in a linked list. void doublyLinkedList::destroy() { nodeType *temp; //p

ointer to delete the node while (first != nullptr) { temp = first; first = first->next; ____ } last = nullptr; count = 0; } Which of the following is the missing statement?
Computers and Technology
1 answer:
Lera25 [3.4K]3 years ago
5 0

Answer:

The answer is "delete temp;".

Explanation:

  • In the given code a class "doublyLinkedList" is defined that contains a method that is destroy(). This code uses a scope resolution operator to define the method outside the class.
  • To access this method write return type of function then class name:: (use scope resolution operator) and function name.
  • In this function, nodeType temp is a pointer variable that is used to delete the node.
  • In method definition, a loop is declared that check value that is first not equal to nullptr. which means the first node is not equal to null. In this loop, a temp variable holds the first variable value and the first variable value is holding another variable value and then use the "delete temp" statement to delete a node in the list.
  • Outside a loop, the last variable holds nullptr variable value and the count variable assigns a value that is 0.
You might be interested in
The Binary Search algorithm works by testing a mid-point, then eliminating half of the list.
Scilla [17]

Answer:

a. True

Explanation:

The Binary Search algorithm works by testing a mid-point, then eliminating half of the list.

8 0
3 years ago
A U.S. social security number consists of a string of 9 digits, such as "444422333". Declare a char array named ssn suitable for
tatuchka [14]

Answer:

Since the question expect us to declare a C-string, the solution code is written in C as follows:

  1.    char ssn[9];
  2.    scanf("%s",ssn);

Explanation:

A C-String is a string written in C language. It is an array of characters. To declare a C-string, we use the keyword, <em>char </em>and then followed with the variable name + brackets and the number of characters in the string. For example, we can create a C-String for the SSN number as in Line 1.

To read standard input into the array, we can use C built-in function, <em>scanf(). </em>Just include a string placeholder, %s, and the variable<em> ssn </em>as arguments to <em>scanf()</em>. This will assign the string input by user to variable <em>ssn</em> as C-String.

8 0
3 years ago
The act of illegally copying software, music,or movies that are copied protect?
miv72 [106K]
It’s protects piracy C
4 0
3 years ago
Read 2 more answers
Write a program that inputs numbers and keeps a
rjkz [21]

I've included my code in the picture below. Best of luck.

3 0
3 years ago
To format an individual sparkline, select the sparkline you want to format, and then click the Ungroup button in the Group group
vichka [17]

Answer:

The answer is "Option a"

Explanation:

A Sparkline is a small graph, which is available inside a sheet, that displays information visually. It displays the information is in the form of patterns on several values. It also uses underline to display the low and high value, use with sparklines, and certain alternatives were wrong, which can be defined as follows:

  • In option b, It is used to define the overall view of data, that's why it is wrong.
  • Option c and Option d both are wrong because, create command is used to create data, or view is used to show that data, they both don't use sparkline option.  
3 0
3 years ago
Other questions:
  • In the scene where we see Don and Lina acting in a silent film (beginning at time code 11:05), describe the silent film. How is
    7·1 answer
  • Write a memo to the vice president, outlining the steps an employee might have taken to create an e-mail message and make it app
    15·1 answer
  • ____ refers to data, applications, and even resources stored on computers accessed over the Internet. Answer
    5·1 answer
  • Order the steps to take when drawing electron dot diagrams.
    15·2 answers
  • Consider a satellite orbiting the earth. Its position above the earth is specified in polar coordinates. Find a model-view matri
    12·1 answer
  • Online banking tools allow you to pay bills from your computer. <br> a. True<br> b. False
    5·2 answers
  • GAMER OYUNCU KOLTUĞU % YERLİ
    6·1 answer
  • A(n) _____ is a firm that delivers a software application, or access to an application, by charging a usage or subscription fee.
    6·1 answer
  • Waygate's residential Internet modem works well but is sensitive to power-line fluctuations. On average, this product hangs up a
    6·1 answer
  • 6
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!