Skip to content

Instantly share code, notes, and snippets.

Deepak Aggarwal aggarwaldeepak

Block or report user

Report or block aggarwaldeepak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View knapsack.java
import java.util.Scanner;
public class knapsack{
public static void main(String args[]){
int n;
Scanner scn = new Scanner(System.in);
n = scn.nextInt();
int[] weight = new int[n];
inputArr(weight, scn);
View sort-permutations.cc
void findPermutations(vector<int>A, int i, vector<vector<int> >& all){
if (i == A.size()){
all.push_back(A);
return ;
}
vector<int> sortedCopy(A);
for(int pos = i; pos < A.size(); ++pos){
swap(sortedCopy[i], sortedCopy[pos]);
A = sortedCopy;
View inplace-rotation.cc
// Deepak Aggarwal, Coding Blocks
// deepak@codingblocks.com
#include <iostream>
using namespace std;
void inputMat(char mat[][10], int m, int n){
for(int r = 0; r < m; ++r){
for(int c = 0; c < n; ++c){
cin >> mat[r][c];
}
}
View gfg-remove-adjacenet-duplicates.cc
#include <bits/stdc++.h>
using namespace std;
void printStr(string& s) {
cout << "X" << s << "X" << endl;
}
void removeDup1(string& s) {
bool duplicateFound = false;
int len = s.size();
View codechef-anumula.cc
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
View picascii.cpp
#include <cstdio>
#include <cstring>
#include <algorithm>
char code[1000];
char inp[1000];
int maxLen = 0;
void decode() {
//prints a pattern corresponding to code
@aggarwaldeepak
aggarwaldeepak / p00183.cpp
Created Oct 12, 2016
UVA 00183 Bit Maps Binary search simulation
View p00183.cpp
#include <bits/stdc++.h>
using namespace std;
#define MAXN 200
char grid[MAXN][MAXN];
void clean(){
char c;
while ((c = getchar()) != '\n' && c != EOF);
}
@aggarwaldeepak
aggarwaldeepak / i
Created Oct 12, 2016
UVA 12032 The Monkey and the Oiled Bamboo
View i
2
5
1 6 7 11 13
4
3 9 10 14
@aggarwaldeepak
aggarwaldeepak / d
Created Oct 12, 2016
UVA 11413 Fill the ...
View d
6
82
1
21
6
20
21
72
2
1
You can’t perform that action at this time.