time complexity calculator online
int sumdigit(int n)
{
int sum = 0;
while (e>0)
{
sum += n%10;
n /=10;
}
return sum;
time complexity calculator online
main()
{
i=n
while(i>=1)
{
i=i-10;
i=i+20;
i=i-30;
}
}
time complexity calculator online
void postorderTraversal(struct Node* node) {
if (node == NULL)
return;
postorderTraversal(node->left);
postorderTraversal(node->right);
cout << node->data << "->";
}
time complexity calculator online
#include
using namespace std;
int main()
{
int a,b;
a = 1;
b = 1;
while(b < n)
{
a += 1;
b += a;
cout<<"Hi";
}
}
time complexity calculator online
sum=0;
for (int j=n ; j >0 ; j=j/2)
{
for (i= j ; i <=n ; i=i*2)
{
sum++;
}
}
time complexity calculator online
while(1)
{
cout<<"HEllo world";
}
time complexity calculator online
for(i=0;i
time complexity calculator online
for i = 1 to n
if i < 16
sum = sum + i
else
break
time complexity calculator online
class Solution {
public:
int minStoneSum(vector& piles, int k) {
int sum=accumulate(piles.begin(), piles.end(), 0);
while(k!=0){
int i=*max_element(piles.begin(),piles.end());
std::vector::iterator it = std::find(piles.begin(), piles.end(), i);
int index = std::distance(piles.begin(), it);
int t=floor(piles[index]/2);
piles[index]=i-t;
sum=sum-t;
k--;
}
return sum;
}
};
time complexity calculator online
#include
void swap(int arr[], int temp, int j){
arr[j]+=arr[temp];
arr[temp]=arr[j]-arr[temp];
arr[j]-=arr[temp];
}
void main(){
int n,i,j,temp;
printf("Enter number of elements: ");
scanf("%d",&n);
int arr[n];
for(i=0;iarr[i+1]) temp=i;
for(j=n-1;j>i;j--){
if(arr[j]
|