This can be done using binary indexed tree. Thanks and Regards, Vishnu Vardan Reddy Onteddu Software Engineer
KeyPoint Technologies India Pvt Ltd. 9Q1A, 9th Floor, Cyber Towers, HITEC City, Madhapur, Hyderabad – 500081. T: +91 40 40337000 Extn 70__ F: +91 40 40337070 www.keypoint-tech.com Be Impressed Try it for Yourself www.adaptxt.com ENGAGING CAPABILITY www.adaptxt.com Registered Address: 123/3RT, SR Nagar, Hyderabad-500038, India. © KeyPoint Technologies UK. All rights reserved. This email plus any attachments is strictly private and confidential. Disclosure, copying, or use, fully or partially is not permitted. Precautions against known computer viruses are attempted. We accept no responsibility / liability for damage or consequences caused by viruses or from unauthorised / unagreed changes. If received mistakenly, inform sender and destroy this email entirely. On Tue, Sep 20, 2011 at 3:28 PM, saurabh agrawal <saurabh...@gmail.com>wrote: > Design an algorithm to perform operation on an array > Add(i,y)-> add value y to i position > sum(i) -> sum of first i numbers > we can use additional array O(n) and worst case performance should be O(log > n) for both operation > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.