How did you determine which method is faster

Assignment Help Computer Engineering
Reference no: EM132194641

Question :

Write a C# program that asks a user for a whole number and prints out the factorial of that number. The program should use three threads (or tasks) to complete the computation.

One thread computes the factorial up to first third, the second thread should compute the factorial of the middle third, and the third thread computes factorial of the last third.

A final thread multiplies all three results to get the final answer. For example, to compute 25!:

25 divided into three approximately equal parts = 8+8+9

Thread1 (or Task1): Result1 = 1*2*3*4*5*6*7*8

Thread2 (or Task2): Result2 = 9*10*11*12*13*14*15*16

Thread3 (or Task3): Result3 = 17*18*19*20*21*22*23*24*25

Final result (Thread/Task4) = Result1*Result2*Result3

Print Final result.

Compare the result of computing the factorial by using a sequential loop and printing the answer.

Which method is faster?

How did you determine which method is faster?

Reference no: EM132194641

Questions Cloud

What is the braking force of the truck : First, what is the (average) braking force of the truck? (Your car weighs about 3300 lbs, which corresponds to a mass of 1500 kg.)
Write a function with a string parameter : Write a C++ function with a string parameter, a character parameter, and an output filestream parameter.
How many excess electrons must be added to one plate : How many excess electrons must be added to one plate and removed from the other to give a 5.00nF parallel-plate capacitor 25.0J of stored energy?
Determine the energy stored in the capacitor : A 5.01-µF capacitor has plates separated by 0.444 mm. It is connected to a 49.0-V voltage supply. When the capacitor is fully charged.
How did you determine which method is faster : Write a C# program that asks a user for a whole number and prints out the factorial of that number.
Define how much mass is oscillating : A harmonic oscillator starts with an amplitude of 20.0 cm. After 10.0 s, the amplitude decreases to 15.0 cm. If the linear damping coefficient is 2.00 Ns/m.
Figure out the number of the array entries in each line : Write a C program containing function bool that checks whether two arrays of the same length len contain the same numbers in some order.
By how much does the energy of the system decrease : Two capacitors are connected parallel to each other and connected to the battery with voltage 25 V . Let C1 = 9.5 µF ,C2 = 5.0 µF be their capacitances.
Do you know what are the things : Four things are considered constant when even modern physics came and with the help of these you can solve any problem in classical mechanics.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Determine the effective memory access time in terms

The access time from the processor to either cache is c clock cycles, and the block is transfer time between the caches and main memory is b block cycles.

  How to identify the location of rubric objectives

Code Comments are used to identify the location of rubric objectives, Code Formatting is used to enhance the readability of the HTML Code.

  The full execution time of the program is

A conditional branch instruction computes the target address and evaluates the condition within the third stage of the pipeline.

  List some examples of your own life experiences

Networks have changed the way we communicate and share resources in a number of ways. Shared resources are a definite advantage of networking.

  Explain the concept of scalability to the team

The project leader wants you to explain the concept of scalability to team. How would you do that? Several managers on the team have heard of TCO but are not quite sure what it is. How would you explain it to them.

  Performance improvement for the least amount of money

suppose in your computer, the most of your daytime processes spend 75 percent of their time running in the CPU and 25% waiting for service from disk.

  Explain what happens in the queens program

The function will know it hit the base case because the position (or the column) is out of bounds (NOT because you generated all possible permutations).

  Why not stl designers simply use pointer instead of iterator

Because a pointer is an iterator, why didn't the STL designers simply use pointers instead of iterators?

  Define a structure datatype for the student

Define a structure datatype for the student. (Use character array of 30 characters for the members fname, lname , cname and enum for gender)

  Compare and contrast the pop e-mail to web-based e-mail

please provide detailed and elaborate responses to the following questions. your responses should include examples from

  What objectives should be sought in design of hash function

What objectives should be sought in the design of a hash function? Name three techniques often built into hash functions.

  Describe the role of operating systems

MN404 - Fundamentals of Operating Systems and Programming - Describe the role of Operating Systems (OS) and its different subsystems in controlling computer

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd