This file contains hidden or 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
| package com.confusedcoders.hive.udf; | |
| import org.apache.hadoop.hive.ql.exec.UDF; | |
| public class AutoIncrUdf extends UDF{ | |
| int lastValue; | |
| public int evaluate() { |
This file contains hidden or 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.sql.SQLException; | |
| import java.sql.Connection; | |
| import java.sql.ResultSet; | |
| import java.sql.Statement; | |
| import java.sql.DriverManager; | |
| public class HiveJDBC { | |
| private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver"; | |
| /** |
This file contains hidden or 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
| package cascading.cascading; | |
| import java.util.Properties; | |
| import cascading.flow.Flow; | |
| import cascading.flow.hadoop.HadoopFlowConnector; | |
| import cascading.operation.aggregator.Count; | |
| import cascading.operation.regex.RegexSplitGenerator; | |
| import cascading.pipe.Each; | |
| import cascading.pipe.Every; | |
| import cascading.pipe.GroupBy; |
This file contains hidden or 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
| package permute; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| public class LexicographicPermutation { | |
This file contains hidden or 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
| package search; | |
| public class RotatedArray { | |
| static int arr[] ={7,8,9,10,11,13,24,1,2,3,4,5,6}; | |
| public static int search(int low, int high){ | |
| if(low>high) | |
| return -1; | |
This file contains hidden or 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
| package strings; | |
| import java.util.Scanner; | |
| public class StringSimilarity { | |
| public static void solution1(){ | |
| Scanner sc = new Scanner(System.in); |
This file contains hidden or 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
| package strings; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.Scanner; | |
| public class StringSimilarity { | |
This file contains hidden or 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
| package trie; | |
| class Node{ | |
| boolean isLeaf; /** isLeaf: Not needed for the code, for future something something **/ | |
| Node[] edges = new Node[26]; | |
| } | |
| public class Trie{ | |
| Node root = new Node(); | |
This file contains hidden or 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
| /********************************************* | |
| My TestCases: | |
| 2 | |
| aab | |
| aac | |
| 3 | |
| 3 | |
| 7 |
This file contains hidden or 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
| class Item{ | |
| Integer data; | |
| Item next; | |
| public Item(){} | |
| public Item(Integer data){ |