Skip to content

Instantly share code, notes, and snippets.

@vinothkumar2
vinothkumar2 / Calc.java
Created September 17, 2021 16:44 — forked from DaveGu/Calc.java
Simple calculator in Java
import java.util.*
//Simple calculator
public class calc
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
double a, b, c = 0.0;
@vinothkumar2
vinothkumar2 / 01knapsack.cpp
Created October 12, 2021 03:18 — forked from zjplab/01knapsack.cpp
0-1 Knapsack problem dynamic programming
#include<stdio.h>
// A utility function that returns maximum of two integers
int max(int a, int b) { return (a > b)? a : b; }
// Returns the maximum value that can be put in a knapsack of capacity W
int knapsack(int val[], int weight[],int w,int n)
{
if(n==0 || w==0 ) return 0;