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
Juliette [100K]
3 years ago
14

Assume an ArrayList and a Linked List each contain 10,000 items. Which operation is performed fastest

Computers and Technology
1 answer:
dmitriy555 [2]3 years ago
3 0

Answer:

ArrayList.get(0,item)

Explanation:

Checking the time of execution of the different operation depends on the machine used and the algorithm written. The worst-case scenario should be used for this analysis.

The 'get()' method of the array list is faster than the get, add and remove() method of the linked list.

You might be interested in
Which method of traversing a tree would result in a sorted list for a binary search tree?
shutvik [7]

Answer:

The inorder traversal make a binary search tree sorted.

Explanation:

The algorithm of inorder traversal is

1.  Traverse the left subtree.

2.  print the data .

3. Traverse the right subtree

In this algorithm left subtree  is visited first then it print the data or visit the data and finally it visited Right subtree .

6 0
3 years ago
Write a program to find a peak in an array of ints. Suppose the array is {-1, 0, 2, 5, 6, 8, 7}. The output should be "A peak is
Sergeeva-Olga [200]

Answer:

Following are the code to this question:

#include<iostream>//declaring header file  

using namespace std;

int main()//main method

{

int n= 6,j=0;//declaring integer variable

int X[n];//defining an array

for(j=0;j<=n;j++)//defining a loop for input value

cin>>X[j];//input value from the user

if(j==0) //defining if block that checks value at beginning

{

if(X[j]>=X[j+1])//defining if block to check to compare first and second value  

{

cout<<"A peak is at array index "<<j<<" and the value is "<<X[j];//use print method to largest value with index number  

}

}

else//defining else block

{

for(j=0;j<=n;j++)//defining for loop for compare other value

{

if(j==n-1) //use if block that checks next index  

{

if(X[j]>=X[j-1])//use if block to compare value  

cout<<"A peak is at array index "<<j<<" and the value is "<<X[j];//use print method to largest value with index number

}

else

{

if(X[j]>=X[j-1] && X[j]>=X[j+1])//comapre value

cout<<"A peak is at array index "<<j<<" and the value is "<<X[j];//use print method to largest value with index number

}

}

}

return 0;

}

Output:

please find the attached file.

Explanation:

In the given code, inside the main method two integer variable "n and j", is declared, in the next step, an array "x"is defined which input the value from the user end.

  • In the next step, multiple if block is used, in the first if block it comapre the first and second value if it grater then it will print the value with its index number.
  • In the next if block, it comapre is next value and if it grater then it will print the value with its index number.  

5 0
3 years ago
Which of the following STEM discoverers developed a new type of computer hardware?
PSYCHO15rus [73]

Which of the following STEM discoverers is known for creating complex computational physics to develop computer models to simulate fluid movement?

Edison

Fedkiw

Gates

Hawking

Answer:

Fedkiw

Explanation:

Ronald Fedkiw is a professor at Stanford and also a STEM discoverer that is credited with developing a new type of computer hardware model which was used to simulate fluid movements.

His invention has helped him win various awards because it has helped professionals and technicians create visual effects for videos.

7 0
4 years ago
True or false a relational database is one in which every data item is related to every other data item
Vilka [71]
I think false, because the rows in a table for instance, do not relate to each other, but can relate to rows in another table, if some of the columns are foreign keys, pointing to primary keys in another table.
8 0
3 years ago
¿como influye la tecnologia en su vida cotidiana?
ANEK [815]

Answer:

La tecnología afecta la forma en que hablamos, aprendemos y pensamos. También nos hemos vuelto dependientes de la tecnología.

Explanation:

3 0
3 years ago
Other questions:
  • The ____ operator eliminates duplicate values in the results of a query.
    11·1 answer
  • What protocol must be supported by routers in order to utilize remote assistance easy connect?
    10·1 answer
  • What is intellectual property?
    7·1 answer
  • The bus width and bus speed together determine the bus's ______ or bandwidth; that is, the amount of data that can be transferre
    5·1 answer
  • When a user logs on to a windows 7 computer using remote desktop, users that are logged on locally are unaffected.?
    10·1 answer
  • Discuss trends in cellular data transmission speeds
    15·2 answers
  • How do i do to use the cumputer very wel?
    14·2 answers
  • Devices that allow for the retention of data when your computer has been shutdown
    10·1 answer
  • The various protocols in use on the internet are said to operate in layers in which the protocol(s) at each layer solve one prob
    5·2 answers
  • What finger should be on the K key?<br> 1. Pinky<br> 2. Index <br> 3. Middle <br> 4. Ring
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!