-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreadme.txt
23 lines (17 loc) · 1.4 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
This repository contains two seprate files for segment and fenwick tree
Instructions for fenwick tree file
1.When you will run the file it will ask for value of n you should enter this is the size of array you want to declare after
that you have to insert elements in the array by providing space between the elements of the array
2. Now you are given with three options namely update the value,find the sum between l to r ,to print the elements stored int the trees,to quit
By printing you wont get the value's stored in the array as fenwick tree doesn't store the actual value of the elements
it always store's sum between ranges
the update function updates the value at index i (both are provided by the user)
the get sum in l to r query takes two value l and r and return the sum of elements in array between l to r
quit is exit from the program
Instructions for Segment tree file
1.When you will run the file it will ask for value of n you should enter this is the size of array you want to declare after
that you have to insert elements in the array by providing space between the elements of the array
2. Now you are given with three options namely update the value,find the sum between l to r ,to quit
the update function updates the value at index i (both are provided by the user)
the get sum in l to r query takes two value l and r and return the sum of elements in array between l to r
quit is exit from the program