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
Sedaia [141]
3 years ago
14

Compare and contrast a linked list and an array.

Computers and Technology
1 answer:
Ostrovityanka [42]3 years ago
4 0

Answer:

Differences between arrays and linked list are as following:-

  1. Arrays store elements in contiguous memory location while the linked list does not store elements at contiguous memory location it connects nodes at different memory location.
  2. Array has index to directly access the elements there are no indexes in linked list to directly access the elements.
  3. Linked list contains Nodes which contains the data and the address of the next Node while the array contains only the data in the block.
  4. Traversal over the arrays is easy while the traversal over the linked list is difficult as compared to arrays.
You might be interested in
While reading difficult content, you should always start witha.Surveying the chapterc.Reading the chapterb.Defining vocabulary w
katrin [286]
When reading difficult content you should- Survey the chapter.

Surveying the chapter allows you to better interpret the literary text and therefore be able to answer the following questions or summarize. 

Hope I helped,
-CSX :)
5 0
3 years ago
What is digital revolution?
oksano4ka [1.4K]
The Digital Revolution refers to the advancement of technology from analog electronic and mechanical devices to the digital technology available today. The era started to during the 1980s and is ongoing. ... The Digital Revolution is sometimes also called the Third Industrial Revolution.
5 0
3 years ago
Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targe
Likurg_2 [28]

Answer:

The program to this question as follows:

Program:

targetValue = 0.3333 #defining variable targetValue and assign value

sensorReading = 0.0 #defining variable sensorReading and assign value

sensorReading = 1.0/3.0 #calculate value in sensorReading variable

Val=sensorReading - targetValue

#calculate the difference and store in Val variable

if (Val < 0.0001): #use of if block to check condition

  print ("Equal")  #print value

else:  #else block

  print ("Not equal") #print value

Output:

Equal

Explanation:

In the above Python program code, there are two variables "targetValue and sensorReading" is defined, in which targetValue store a value, that is "0.3333", and sensorReading holds a value, that is "0.0".

  • In the next step, the "Val" variable is defined, that calculate the difference between both variable, that conditional statement is used.
  • In if block, if the value is less then "0.0001", it will print value "Equal", otherwise, it will go to the else block, that will print "Not equal".
3 0
3 years ago
Read 2 more answers
Difference between website and web server
Volgvan

Answer:

a web server is a computer than runs websites

7 0
2 years ago
Read 2 more answers
Write a method that accepts a String object as an argument and returns a copy of the string with the first character of each sen
emmainna [20.7K]

Answer:

The programming language is not stated; However, the program written in C++ is as follows: (See Attachment)

#include<iostream>

using namespace std;

string capt(string result)

{

result[0] = toupper(result[0]);

for(int i =0;i<result.length();i++){

 if(result[i]=='.' || result[i]=='?' ||result[i]=='!')  {

 if(result[i+1]==' ') {

  result[i+2] = toupper(result[i+2]);

 }

 if(result[i+2]==' ')  {

  result[i+3] = toupper(result[i+3]);

 }

 } }

return result;

}

int main(){

string sentence;

getline(cin,sentence);

cout<<capt(sentence);

return 0;

}

Explanation:

<em>The method to capitalize first letters of string starts here</em>

string capt(string result){

<em>This line capitalizes the first letter of the sentence</em>

result[0] = toupper(result[0]);

<em>This iteration iterates through each letter of the input sentence</em>

for(int i =0;i<result.length();i++){

This checks if the current character is a period (.), a question mark (?) or an exclamation mark (!)

if(result[i]=='.' || result[i]=='?' ||result[i]=='!')  {

 if(result[i+1]==' '){  ->This condition checks if the sentence is single spaced

  result[i+2] = toupper(result[i+2]);

-> If both conditions are satisfied, a sentence is detected and the first letter is capitalized

 }

 if(result[i+2]==' '){ ->This condition checks if the sentence is double spaced

  result[i+3] = toupper(result[i+3]);

-> If both conditions are satisfied, a sentence is detected and the first letter is capitalized

 }

}

}  <em>The iteration ends here</em>

return result;  ->The new string is returned here.

}

The main method starts here

int main(){

This declares a string variable named sentence

string sentence;

This gets the user input

getline(cin,sentence);

This passes the input string to the method defined above

cout<<capt(sentence);

return 0;

}

Download cpp
7 0
3 years ago
Other questions:
  • You are able to change the formatting of a table after it is inserted into a placeholder. True or false
    9·2 answers
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • When adding cells you must use a "+" symbol, you cannot use a ":" symbol.<br><br> ☐ True<br> ☐ False
    13·1 answer
  • A vacuum tube that contains a grid can be classified as a A. rectifier B. triode C. pentode D. diode
    12·1 answer
  • Which statement describes what this command accomplishes when inside and outside interfaces are correctly identified for NAT? ip
    13·1 answer
  • An article explaining the uses of the parts of a computer​
    14·1 answer
  • Rosa is building a website for a multimedia company. She wants to add a drop-down menu functionality to the website's main page.
    12·1 answer
  • What is an operating system that controls some aspects of the computer?
    10·2 answers
  • 1. Name the three kinds of Eraser in Photoshop. <br>​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!