I’ve got an array of integers and i was wondering how you would code for a cumulative frequency array. should i use a for loop or is there a quicker way.
e.g given integers: 1 2 3 4 5 6 7 8
the new array would print: 1 3 6 10 15 21 28 36
thanks!
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.
one way, very inefficient:
looping and summing is much better: