Instantly share code, notes, and snippets.

# Deepak Aggarwalaggarwaldeepak

• Sort options
Created Jul 17, 2018
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);
Created Jun 17, 2018
View algoDemo
 Hi This is a demo
Created Jun 13, 2018
View sort-permutations.cc
 void findPermutations(vectorA, int i, vector >& all){ if (i == A.size()){ all.push_back(A); return ; } vector sortedCopy(A); for(int pos = i; pos < A.size(); ++pos){ swap(sortedCopy[i], sortedCopy[pos]); A = sortedCopy;
Created Jun 7, 2018
View inplace-rotation.cc
 // Deepak Aggarwal, Coding Blocks // deepak@codingblocks.com #include 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]; } }
Created Jun 1, 2018
#josh #stack #must
 #include using namespace std; void printStr(string& s) { cout << "X" << s << "X" << endl; } void removeDup1(string& s) { bool duplicateFound = false; int len = s.size();
Created Jun 1, 2018
View codechef-anumula.cc
 #include #include #include #include #include #include #include #include #include #include
Created Aug 24, 2017
Thug Life Code
View picascii.cpp
 #include #include #include char code[1000]; char inp[1000]; int maxLen = 0; void decode() { //prints a pattern corresponding to code
Created Oct 12, 2016
UVA 00183 Bit Maps Binary search simulation
View p00183.cpp
 #include using namespace std; #define MAXN 200 char grid[MAXN][MAXN]; void clean(){ char c; while ((c = getchar()) != '\n' && c != EOF); }
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
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.