Skip to content

This is a small program in C and C++ that I used for the transversal block of the Probability and Statistics subject of the Software Engineering degree at FIB UPC.

Notifications You must be signed in to change notification settings

marrqqss/C-vs-Cpp-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is to study the difference in execution times between C and C++ programs for the subject of Probability and Statistics. We have created two generic codes equivalent in complexity and implementation, one in C and the other in C++. What these two codes do is filling the positions of an initially empty array of random size between 0 and 2²⁰ with the summation of 0 <= n < array size, where n is the array position. At the end of the execution, both codes save the execution time in a .txt format file.

To have a large enough sample and to ensure that the results are completely random and not adulterated by the state of the computer when executing the programs, we created a "parent" program that randomly executed the C or C++ implementation 80 times (50% chance for each). Trying to achieve the randomness of the results, we have also implemented the execution sequentially instead of concurrently, which avoids that the CPU must be distributed among several processes and the computer performance and execution time are affected.

About

This is a small program in C and C++ that I used for the transversal block of the Probability and Statistics subject of the Software Engineering degree at FIB UPC.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published