Is it possible to obtain a Big O estimate of Math.random()?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure this question makes much sense. There’s no variable size input to increase gauge complexity against – you make a call (with no arguments) and you get an output.
Are you asking if the Math.random() method takes longer for successive calls? Or if it’s just slower than it should be?
Remember that even algorithms with
O(1)complexity can take a long time – it’s just that the length of time they take doesn’t depend on how much data is involved.