online compiler c++ with big O calculator
int func(int n,int m){ if (n==2) return n-m; else return m*func(n-2,m-1)+1; }
online compiler c++ with big O calculator
int i=0; int sum=0; while (i < 100) { if (i % 2 == 0) { for (int k = 0; k < n; k++) { sum += vec[i]; } } else { for (int k=0; k<i; k++) { sum += vec[i]; } } }
online compiler c++ with big O calculator
for(i=1;i<10;i*=6) for(j=10;j>=1;j--){ s=s+j; t=t+i;}
online compiler c++ with big O calculator
for (int i = 1; i < n; i++) { for (int j = 0; j < i * i; j++) { } }
online compiler c++ with big O calculator
#include <bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int c=1;int i=0; int j=0,k=0;int ans=0; int a[n]; for(i=0;i<n;i++){cin>>a[i];} for(;k<n;){ for(int j=k;j<n;j++){if(a[j]>=a[j-1]) c++; else break; } if(c>ans) ans=c; k++; c=1; } cout<<ans;}
online compiler c++ with big O calculator
Algorithm1(int n) for (i=0; i<n; i+=3) print(i)
online compiler c++ with big O calculator
#include <iostream> using namespace std; int recursive_sum(int m, int n) { if (m == n) return m; return m + recursive_sum(m + 1, n); } int main() { int m=1, n=5; cout<<"Sum = "<<recursive_sum(m, n); }
online compiler c++ with big O calculator
if(a<b){ y = 50 * x + fun(n); count++; } else{ j = 1 while j< n{ count++; j*=2 }}
online compiler c++ with big O calculator
#include<iostream> using namespace std; int main () { int arr[100], n, i, max, min; cout << "Enter the number of the students given quiz : "; cin >> n; cout << "Enter the marks scored by them : "; for (i = 0; i < n; i++) cin >> arr[i]; max = arr[0]; for (i = 0; i < n; i++) //finding maximum score. { if (max < arr[i]) max = arr[i]; } min = arr[0]; for (i = 0; i < n; i++) //finding minimum score. { if (min > arr[i]) min = arr[i]; } cout << "top score : " << max<<"\n"; cout << "least score : " << min; return 0; }
online compiler c++ with big O calculator
for (int i = 1 ; i <= N-1 ; i++) { if ( i < 1 ) //assume always False { A = i + 10; B = A + N; } else if ( i > N) //assume always False { A = i +5; B = A + 10; } else { A = i + 20; B = A + 5; } }