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
#include <stdio.h> | |
#include <string.h> | |
struct Book { | |
char title[100]; | |
char author[100]; | |
int number_of_pages; | |
}; | |
int main() { |
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
# We multiply 10s 4 times together to get 10000 | |
print(10*10*10*10) | |
print(2*2*2*2*2) | |
from math import log, ceil | |
print(log(10000, 10)) # how many times do we multiply 10 together to get 10000? | |
print(log(32, 2)) # how many times do we multiply 2 together to get 32? |
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
int arr[5] = {4, 2, 3, 8, 1, 9}; | |
int sum[5] = {4}; | |
for (int i = 1; i < 5; i++) sum[i] = sum[i-1] + arr[i]; | |
int a = 1, b = 3; | |
// print the sum for the range [a,b] | |
cout << sum[b]-sum[a-1] << endl; |
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
#define MX 6 | |
int arr[MX]; | |
int tree[MX*4]; | |
void build(int node, int b, int e) { | |
if (b == e) { | |
tree[node] = arr[b]; | |
return; | |
} |
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
int query(int node, int b, int e, int l, int r) { | |
// no overlap | |
if (b > r || e < l) return 0; | |
// total overlap | |
if (b >= l && e <= r) return tree[node]; | |
// partial overlap | |
int left = 2*node; | |
int right = 2*node + 1; |
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
void update(int node, int b, int e, int i, int newval) { | |
// index is out of range | |
if (b > i || e < i) return; | |
// we're at leaf node | |
if (b == i && e == i) { | |
tree[node] = newval; | |
a[i] = newval; | |
return; | |
} |
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); |
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
AIUBian Android App |
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
## Privacy Policy | |
Sazid built the Locker app as an Ad Supported app. This SERVICE is provided by Sazid at no cost and is intended for use as is. | |
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. | |
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. | |
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Locker unless otherwise defined in this Privacy Policy. |
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
## Privacy Policy | |
Sazid built the Unlockify app as an Ad Supported app. This SERVICE is provided by Sazid at no cost and is intended for use as is. | |
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. | |
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. | |
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Unlockify unless otherwise defined in this Privacy Policy. |