You are not logged in. Please login at to post your questions!


marblegef DOUBT..

i did this problem using segmented tree concept..but i am getting tle...editorial say to use fenwick tree concept......But i came to know both fenwick tree and segmented tree have same time complexity in worst case which is O(mlogn)....anyone clear my doubt plsss.....thanks in advance:)

this is my code which uses the concept of segment tree

asked 17 Feb '14, 16:33

chaseme's gravatar image

accept rate: 0%

edited 17 Feb '14, 20:12

I read somewhere that the constant factor in complexity calculation of segment tree is more than BIT. So for extremely steep time limit, BIT is effective.


answered 18 Feb '14, 20:40

dragonemperor's gravatar image

accept rate: 10%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 17 Feb '14, 16:33

question was seen: 751 times

last updated: 18 Feb '14, 20:40