This file contains 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 <iostream> | |
using namespace std; | |
/* Driver of the program */ | |
int main() | |
{ | |
//8,2 | |
int arr[] = {1,6,8,1,5,2,0,5,6,1,0}; | |
cout<<"Start"<<endl; |
This file contains 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 <iostream> | |
#include<math.h> | |
using namespace std; | |
int bit = 0; | |
int nibble = 0; | |
int bite = 0; | |
int times = 0; |
This file contains 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 <iostream> | |
using namespace std; | |
int maxSubArray(int *arr,int n) | |
{ | |
int sum = 0, max = -1; | |
for(int i = 0 ; i < n ; i++) | |
{ | |
for(int j = i ; j < n ; j++) |
This file contains 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
//Ali Hasan | |
#include <iostream> | |
using namespace std; | |
int maxSubArray(int *arr,int n) | |
{ | |
int sum = 0, max = -1; | |
for(int i = 0 ; i < n ; i++) |
This file contains 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 surfaceArea(vector<vector<int>> v) { | |
int area = 0; | |
int row = v.size(); | |
int c = v[0].size(); | |
int t, b, u, d, l, r; | |
for(int i = 0 ; i < row ; i++) |
This file contains 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 gcd(int a, int b) | |
{ | |
// Everything divides 0 | |
if (a == 0 || b == 0) | |
return 0; | |
// Base case | |
if (a == b) | |
return a; |
This file contains 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 <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int A[202][202], B[202][202]; | |
char S[202][202]; |
This file contains 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 <iostream> | |
#include <string.h> | |
using namespace std; | |
void _LCS(string S, string T, | |
int i, int j, | |
string ans = "",string str = "") | |
{ | |
if(T.length() > S.length()) |
This file contains 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<iostream> | |
using namespace std; | |
int LIS(int* arr, int n,int *max) | |
{ | |
if(n==1) return 1; | |
int temp = 1; |
This file contains 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<iostream> | |
using namespace std; | |
double func(double x) | |
{ | |
return x*x*x - 2*x - 5; | |
} | |
void bisection(double a, double b) |