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 <stdio.h> | |
//#include <alloc.h> | |
int main(void){ | |
printf("Check the ram usage and press any to start the process"); | |
getchar(); | |
int c=0; | |
void *v=NULL; | |
v=malloc(1); | |
void (* va[33000]); | |
printf("Reached till array with size %d\n",sizeof(va)); |
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
//Enter the input as commandline arguments | |
public class Problem_B{ | |
public static void main(String args[]){ | |
//System.out.println("Positive Sum"); | |
//if(args[0]=='')System.out.println("Please Enter Commandline Arguments"); | |
if(args[0].charAt(0)=='-')System.out.println("Enter Positive No. of Test Cases"); | |
int Test_Cases=Integer.parseInt(args[0].substring(0,1)); | |
//System.out.println(args[0].substring(0,1)); | |
int T[]=new int[Test_Cases]; | |
if(args[0].charAt(1)=='-' || args[0].charAt(2)=='-')System.out.println("Enter Positive count of numbers in 1st Test Case"); |
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
-------------------------------------------------------- | |
-- File created - Tuesday-August-19-2014 | |
-------------------------------------------------------- | |
-------------------------------------------------------- | |
-- DDL for Table EXPENSE | |
-------------------------------------------------------- | |
CREATE TABLE "EXPENSE" | |
( "ID" NUMBER, | |
"AMOUNT" NUMBER, |
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<stdio.h> | |
int main() | |
{ | |
int a = 10, b,x=0; | |
a >=5 ? b=100:b= 200; | |
printf("%d\n", b); | |
return 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
/** | |
* Created by gagan on 27/3/16. | |
*/ | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
public class TestClass { | |
public static void main(String args[]) throws Exception { |
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
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.math.BigInteger; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* Created by gagan on 2/4/16. | |
*/ | |
public class Tour { |
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
/** | |
* Created by gagan on 2/4/16. | |
*/ | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.math.BigInteger; | |
import java.util.Arrays; | |
public class Criminal { |
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
Coding question: Write a function to check if a binary tree is a sum tree. Here, sum tree is defined as a binary tree in which every node's value equals the sum of values of left and right child nodes. (Leaf nodes can have any value). | |
Problem solving question: Given an array comprising odd number of non-negative integers, you have to remove one element from it and divide the remaining array into two arrays of equal size, such that their sum of elements are also equal. If such a partition is not possible, you have to determine that. If such a partition is possible you have to identify one possible solution. How do you go about solving such a problem. |
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
println("Hello Thoughtworks !") | |
val numbers = List(1,2,3,4); | |
numbers.map(x=> x+1).reduce(_+_); | |
val squareOf = (x:Int, y:Int) =>x*y | |
squareOf(4,5) |
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
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; |
OlderNewer