Category: ACM
code: 1<=N<=10^5 1<=A[i]<=10^9 1<=M<=10^9 Source: https://www.facebook.com/groups/bengaliprogramming/permalink/717276125110930/
Default : Source: https://www.hackerearth.com/practice/algorithms/searching/linear-search/tutorial/ code: /* hackerearth linear search test */ #include<stdio.h> int main() { //long long int…
code: /* Count Frequency in an Array(Optimized Version) Syed Ahmed Zaki — 2017 */ #include<stdio.h> int linear_search(int…
Some theory: code: /* Count Frequency in an Array Syed Ahmed Zaki — 2017 */ #include<stdio.h> int…
iterative code: #include<stdio.h> int binarysearch(int A[],int n,int x) { int low=0, high=n-1; while(low<=high) { int mid=(low+high)/2; //eta…
Google Search: https://www.google.com/search?q=Counting+2s&ie=utf-8&oe=utf-8&client=firefox-b#q=Counting+2s+in+c SOlution: https://www.careercup.com/question?id=56794 //https://www.careercup.com/question?id=56794 #include<stdio.h> int main() { int n,i,j; int ctr=0; scanf(“%d”,&n); for(i=0;i<=n;i++) { for(j=i;j>0;j=j/10) {…
Recent Comments