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


Explain the public section

Please explain the public section of the solution.

asked 27 Nov '17, 19:35

gautamcse27's gravatar image

accept rate: 0%

Read this with patience. It's a great editorial for someone who wants to learn segment trees. The public section of the solution which you mentioned mainly performs two functions - Updates the segment tree (see the private section below for the working of the function change()), and queries the segment tree between l and r. I suggest you to read the editorial carefully and follow the steps, which will makes things clear.

List of problems using segment tree of easy and medium difficulty along with some great resources to learn can be found here.


answered 06 Dec '17, 01:34

ashutosh450's gravatar image

accept rate: 40%

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: 27 Nov '17, 19:35

question was seen: 255 times

last updated: 06 Dec '17, 01:34