Last active
June 17, 2018 22:51
-
-
Save sazid/66d602060882ba88ee276ffe2c3ec3fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// arr[] = {4, 2, 3, 8, 1, 9} | |
// tree[] | |
// build(...) | |
// query(...) | |
// update(...) | |
int main() { | |
// 1 দিয়ে রুট নোড বুঝনো হয়েছে | |
build(1, 1, MX); | |
// [2, 5] রেঞ্জ কুয়েরি করবো | |
cout << query(1, 1, MX, 2, 5) << endl; | |
// 3 নম্বর ইন্ডেক্সটি আপডেট করে 10 সেট করবো | |
update(1, 1, MX, 3, 10); | |
cout << query(1, 1, MX, 2, 5) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment