Kriti's blog

By Kriti, 9 years ago, In English

As such i know Segment Tree implementation of variants and have implemented it half dozen times ,still Segment Tree has become a problem which i am getting WA continously in general . How do you give a shot to debugging segment tree solution in general ?

Also every blog i read about Segment Tree ,they pictured Segment Tree of 2^n elements which is simple but i really dont know how to picture up Segment Tree formed out k nodes where k!=2^n :/ Can leafs of such a tree be at different heights ? I mean when i print out my ST linearly is it necessary for leaves to be in same order as the original array from which i constructed segment tree?

Thnksy in adv ^_^

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it