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
artcher [175]
3 years ago
8

Write three functions in C/C++: one that declares a large array statically, one that declares the same large array on the stack,

and one that creates the same large array from the heap. Call each of the subprograms a large number of times (at least 100,000) and output the time required by each. Explain the results. Explain why or why not you cant do this in Java, what are the implication of this? If you can’t specify which type of array can you not declare.
Computers and Technology
1 answer:
Nikolay [14]3 years ago
7 0

Answer:

See explaination

Explanation:

#include<iostream>

#include<stack>

#include <algorithm> // std::make_heap, std::pop_heap, std::push_heap, std::sort_heap

#include <vector> // std::vector

using namespace std;

void StaticArray()

{

unsigned int array[64536];

for(unsigned int i=0;i<64536;i++)

array[i]=i;

}

void Stack()

{

stack<unsigned int> mystack;

for(unsigned int i=0;i<64536;i++)

mystack.push(i);

}

void Heap()

{

unsigned int myints[64536];

for(unsigned int i=0;i<64536;i++)

myints[i]=i;

vector<unsigned int> v(myints,myints+64535);

make_heap (v.begin(),v.end());

push_heap (v.begin(),v.end());

}

int main()

{

StaticArray();

Stack();

Heap();

return 0;

}

You might be interested in
What's the difference in unicode value between 'e' and 'a'? (consult a table of unicode values):?
ddd [48]
-4






--------------------------------------
3 0
3 years ago
Each array in Java has a public field named ________ that contains the number of elements in the array.
Helen [10]

Answer:

length.

Explanation:

length variable determines the size of the array or the number of elements in the array.length variable is a final variable.It is a public field.It is only applicable for array it is not applicable for strings.It is also used to directly access the field member of the array.So we conclude that the answer is length.

7 0
4 years ago
A local router is configured to limit the bandwidth of guest users connecting to the Internet. Which of the following best expla
mariarad [96]

Answer:

The correct option is d. Guest users will be restricted in the maximum amount of data that they can send and receive per second.

Explanation:

Bandwidth can be described as the maximum data transfer that an internet connection or a network has. It gives a measure of the amount of data that can be transmitted over a particular connection in a particular amount of time. For instance, the capacity of a gigabit Ethernet connection is 1,000 megabits per second (Mbps) (which also translates to 125 megabytes per second).

Therefore, when a local router is configured to limit the bandwidth of guest users connecting to the Internet, it will restrict the the maximum amount of data that they can transmit per second.

Therefore, the correct option is d. Guest users will be restricted in the maximum amount of data that they can send and receive per second.

3 0
3 years ago
Who usually signs a collection letter?
murzikaleks [220]
A collection letter is usually signed by THE OFFICE PROFESSIONAL. 
A collection letter refers to the letter written by a company to a debtor in order to remind him or her about pending debts. The letter is usually written by the office holder  that is responsible for that task. Professionals in the accounting department are often responsible for this.<span />
4 0
3 years ago
Read 2 more answers
What is the key value proposition of Google Search campaigns?A. Appear as a text ad, a video ad, or a banner ad on one of Google
crimeas [40]

Answer:

The correct option is D: Show your ads when a customer is searching for your product or service

Explanation:

Google Search Campaigns allows for advertisement display when you run a search on Google Search. It then displays the result of the search in the search results. The key value proposition of Google Search Campaigns is "Show your ads when a customer is searching for your product or service". Google Search Campaigns are known to be a very popular online advertising form.

5 0
3 years ago
Other questions:
  • Ashton Auto Place is a car dealer for new as well as used cars of all makes. It uses computerized Transaction Processing System
    7·1 answer
  • According to Gitlin, during the 1950s and 60s television production costs began to exceed the licensing fees the networks paid i
    10·1 answer
  • answer for brainliest Today, trending current events are often present on websites. Which of the following early developments in
    15·1 answer
  • If the derived class does not override a public member function of the base class, you may specify a call to that public member
    7·1 answer
  • What does scarcity force people to do?
    11·1 answer
  • In modern web design, color, font, font size, and style should be declared using:
    5·1 answer
  • Which state legislation requires companies to report security breaches within 48 hours
    6·1 answer
  • In what way was the Ohio River Valley a factor in the French and Indian War? The Ohio River Valley was controlled by both France
    8·2 answers
  • Which of the following factors will have the greatest impact on your credit score? I. Length of Credit History II. Payment Histo
    6·2 answers
  • You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Whi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!