answer.
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]
2 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]2 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
Kris, an IT manager at Park Infosystems, is handling four projects simultaneously. Each project has loaned and shared resources
Natalija [7]

Answer:

many-to-many relationship

Explanation:

They are different types of relationship between projects. A many-to-many relationship occurs when a row in a table associates with many related rows in another table. For example the relationship between an employee and a project, An employee can work on many projects and a project can have many employees working on it.

8 0
2 years ago
Read 2 more answers
Problem 1a. Write a function named hasFinalLetter that takes two parameters 1. strList, a list of non-empty strings 2. letters,
mash [69]

Answer:

The answer is the programming in Python language has strings and characters that has to be declared in the method.

Explanation:

#method

def hasFinalLetter(strList,letters):

output = #output list

#for every string in the strList

for string in strList:

#findout the length of each string in strList

length = len(string)

#endLetter is last letter in each string

endLetter = string[length-1]

#for each letter in the letters list

for letter in letters:

#compare with endLetter

#if we found any such string

#add it to output list

if(letter == endLetter):

output.append(string)

#return the output list

return output

#TestCase 1 that will lead to return empty list

strList1 = ["user","expert","login","compile","Execute","stock"]

letters1 = ["a","b","y"]

print hasFinalLetter(strList1,letters1)

#TestCse2

strList2 = ["user","expert","login","compile","Execute","stock"]

letters2 = ["g","t","y"]

print hasFinalLetter(strList2,letters2)

#TestCase3

strList3 = ["user","expert","login","compile","Execute","stock"]

letters3 = ["k","e","n","t"]

print hasFinalLetter(strList3,letters3)

8 0
2 years ago
Which computer applications can Mr. Crowell use to make the classroom learning more stimulating and interesting? Mr. Crowell has
katovenus [111]

Answer:

He can use following computer program to make the class room more interesting and effective:-

  • 1. <u>Reference software</u> : This software help students to access the atlases and dictionaries.Teacher can include this software in research projects .

  • 2. <u>Educational Games</u>: This types of software is very effective for younger children because it motivates them to learn.This software companies have combined gaming and education into one .

  • 3. <u>Graphical software</u> : Student can use this software to create and changes images available on the internet itselfs .
4 0
2 years ago
Read 2 more answers
Which of the following would be a considered a want rather than a need for most people?
UNO [17]

c. would be the best answer.


3 0
2 years ago
A mobile device user has tried to install a new app numerous times without success. She has closed all unused apps, disabled liv
elena-14-01-66 [18.8K]

The correct answer is B. Check for sufficient available storage space.  

Explanation:

One of the factors that can cause it is not possible to install a new app is insufficient storage as space in the mobile device is needed to save the app. This can be easily solved either by deleting apps and other content or expanding the memory available through a Micro SD card. Also, before attempting any major procedure such as a complete reset it is important to check the storage space availability. In this context, the user should check for sufficient available storage space (option B) because this might be the cause of the issue she is experiencing; also, this is a basic step before considering others such as performing a factory reset.

6 0
2 years ago
Other questions:
  • Consider a simple application level protocol built on top of udp that allows a client to retrieve a file from a remote server re
    15·2 answers
  • In cell q9 enter a formula using the countif function and structured references to count the number of staff members who have pa
    9·1 answer
  • covers a wide variety of applications such as web and computer-based training (CBT), and social networks. a. E-learning b. Model
    10·1 answer
  • Drag each tile to the correct box.
    12·1 answer
  • Which fact does lean green eco machines present to show that electric cars are not perfect
    13·2 answers
  • Sarah works in a coffee house where she is responsible for keying in customer orders. A customer orders snacks and coffee, but l
    13·2 answers
  • Why do agriculture and natural resource systems vary from state to state?
    8·1 answer
  • ) A byte is used to represent a single character in the computer ______<br> true or false?
    14·2 answers
  • Describe the ways in which a computer-aided design (CAD) drawing makes the details of an image easier to understand.
    11·2 answers
  • One tool of Lean that is a container, card, or visual limit that signals when work needs to be done or replenishment needs to be
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!