![]() |
VOOZH | about |
In statistical analysis, the standard deviation is a quantity that measures how much the data points are spread over the dataset. It indicates how much the single data points deviate from the mean (average) of the dataset. In this article, we look at how to find the standard deviation of the numeric elements of the Array in C++.
For Example,
Input:
myArray = { 5, 10, 15, 20, 25, 30, 35, 40,
45, 50, 55, 60, 65, 70, 75 }
Output:
Standard_Deviation = 21.6025
To calculate the standard deviation, we first need to calculate the mean and variance of the dataset. The formula for mean, variance, and standard deviation is as follows:
Mean (Average)
Standard Deviation = 21.6025
Time Complexity: O(n) - where 'n' is the number of elements in the array.
Space Complexity: O(1)