algorithms icon indicating copy to clipboard operation
algorithms copied to clipboard

segment trees questions added

Open Manish2397 opened this issue 6 years ago • 2 comments

Segment trees tutorial with question added.

Manish2397 avatar Sep 26 '19 16:09 Manish2397

Hello @Manish2397,

This seems to be code for segment trees. Your PR is labeled as questions for segment trees. Also consider formatting your code well and adding testcases to it.

papachristoumarios avatar Sep 26 '19 18:09 papachristoumarios

Hello @Manish2397 , thanks for contributing. Can you please move the Segment tree folder to Data Structures/ Advanced DS/ Segment Trees instead of the root folder so as to follow the structure described in README?

We would also like you to provide a more thorough documentation of the code, as also indicated by @papachristoumarios.

Lastly, instead of implementing 2 segment trees (one for min/max querries and one for range sum querries) you could implement 1 generic segment tree that works with a function f (int f(int x, int y)). In the first case f would be int f(int x, int y){ return min(x,y); } and in the range sum segment tree it would be: int f(int x, int y){ return x+y; }

mstou avatar Sep 27 '19 09:09 mstou