Horje
time complexity calculator online Code Example
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<bits/stdc++.h>
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<n;i++)
for(j=0;j<m;j++)
{
sum=sum+a[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<int>& piles, int k) {
        int sum=accumulate(piles.begin(), piles.end(), 0);
        while(k!=0){
            int i=*max_element(piles.begin(),piles.end());
            std::vector<int>::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<stdio.h>
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;i<n;i++){
		printf("\nEnter element %d: ",i+1);
		scanf("%d",&arr[i]);
	}
	for(i=0;i<n-1;i++){
		if(arr[i]>arr[i+1]) temp=i;
		for(j=n-1;j>i;j--){
			if(arr[j]<arr[temp]) swap(arr,temp,j);
		}
	}
	printf("\nSorted Array:");
	for(i=0;i<n;i++){
		printf("  %d",arr[i]);
	}
}




Cpp

Related
"how we write a program for" time swap" in c plus plus only with string" Code Example "how we write a program for" time swap" in c plus plus only with string" Code Example
find the smallest window in a string containing all characters of another string Code Example find the smallest window in a string containing all characters of another string Code Example
ue4 c++ add tag Code Example ue4 c++ add tag Code Example
c++ program for inflation rate of two numbers Code Example c++ program for inflation rate of two numbers Code Example
Fibonacci in c++ Code Example Fibonacci in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11