LeetCode 273 - Integer to English Words


https://leetcode.com/problems/integer-to-english-words/
Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.
Example 1:
Input: 123
Output: "One Hundred Twenty Three"
Example 2:
Input: 12345
Output: "Twelve Thousand Three Hundred Forty Five"
Example 3:
Input: 1234567
Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"
Example 4:
Input: 1234567891
Output: "One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety One"
https://github.com/mintycc/OnlineJudge-Solutions/blob/master/Leetcode/273_Integer_to_English_Words.java
2. -num也会overflow; array index should be int
考虑负数

    final static int[] POW10 = {1, 10, 100, 1000, 0, 0, 1000000, 0, 0, 1000000000};
    final static String[] ONES  = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
    final static String[] TENS = {"", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
    
    public String numberToWords(int num) {
        if (num == 0) return "Zero";
        boolean negative = false;
        long n = num;
        if (num < 0) {
            negative = true;
            n = -n;
        }
        
        String rtn = helper(n);
        return negative ? "Negative " + rtn : rtn;
    }
    
    private String helper(long n) {
        String rtn = "";
        if (n < 20) rtn = ONES[(int)n];
        else if (n < POW10[2]) rtn = TENS[(int)n / POW10[1]] + " " + ONES[(int)n % POW10[1]];
        else if (n < POW10[3]) rtn = ONES[(int)n / POW10[2]] + " Hundred " + helper(n % POW10[2]);
        else if (n < POW10[6]) rtn = helper(n / POW10[3]) + " Thousand " + helper(n % POW10[3]);
        else if (n < POW10[9]) rtn = helper(n / POW10[6]) + " Million " + helper(n % POW10[6]);
        else rtn = helper(n / POW10[9]) + " Billion " + helper(n % POW10[9]);
        return rtn.trim();
    }

    final static String[] HUNDS = {"Hundred", "Thousand", "Million", "Billion"};
    final static String[] ONES  = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
    final static String[] TENS = {"", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
    
    public String numberToWords(int num) {
        if (num == 0) return "Zero";
        
        boolean negative = false;
        long n = num;
        if (num < 0) {
            negative = true;
            n = -n;
        }
        
        List<String> ans = new ArrayList<String>();
        int cnt = -1;
        while (n > 0) {
            int hunds = (int)(n % 1000);
            n /= 1000; ++ cnt;
            if (hunds == 0) continue;
            if (cnt > 0) ans.add(HUNDS[cnt]);
            
            int tens = hunds % 100;
            if (tens > 0 && tens < 20) ans.add(ONES[tens]);
            else {
                if (tens % 10 > 0) ans.add(ONES[tens % 10]);
                if (tens / 10 > 0) ans.add(TENS[tens / 10]);
            }
            if (hunds / 100 > 0) {
                ans.add(HUNDS[0]);
                ans.add(ONES[hunds / 100]);
            }
        }
        
        if (negative) ans.add("Negative");
        Collections.reverse(ans);
        return String.join(" ", ans);
    }


http://blog.welkinlan.com/2015/09/29/integer-to-english-words-leetcode-java/
public class Solution {
private final String[] lessThan20 = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
private final String[] tens = {"", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
private final String[] thousands = {"", "Thousand", "Million", "Billion"};
public String numberToWords(int num) {
if (num == 0) {
    return "Zero";
}
String result = "";
int i = 0;
while (num > 0) {
    if (num % 1000 != 0) {
        result = helper(num % 1000) + thousands[i] + " " + result;    
    }
    num /= 1000;
    i++;
}
return result.trim();
}
private String helper(int num) {
    if (num == 0) {
        return "";
    } else if (num < 20) {
        return lessThan20[num] + " ";
    } else if (num < 100) {
        return tens[num / 10] + " " + helper(num % 10);
    } else {
        return lessThan20[num / 100] + " Hundred " + helper(num % 100);
    }
}
}


https://www.bbsmax.com/A/D854p0w5Eg/
https://leetcode.com/problems/integer-to-english-words/discuss/70627/Short-clean-Java-solution
    private final String[] belowTen = new String[] {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};
    private final String[] belowTwenty = new String[] {"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
    private final String[] belowHundred = new String[] {"", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
    
    public String numberToWords(int num) {
        if (num == 0) return "Zero";
        return helper(num); 
    }
    
    private String helper(int num) {
        String result = new String();
        if (num < 10) result = belowTen[num];
        else if (num < 20) result = belowTwenty[num -10];
        else if (num < 100) result = belowHundred[num/10] + " " + helper(num % 10);
        else if (num < 1000) result = helper(num/100) + " Hundred " +  helper(num % 100);
        else if (num < 1000000) result = helper(num/1000) + " Thousand " +  helper(num % 1000);
        else if (num < 1000000000) result = helper(num/1000000) + " Million " +  helper(num % 1000000);
        else result = helper(num/1000000000) + " Billion " + helper(num % 1000000000);
        return result.trim();
    }

X. Iterative
https://leetcode.com/problems/integer-to-english-words/discuss/70625/My-clean-Java-solution-very-easy-to-understand
private final String[] LESS_THAN_20 = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
private final String[] TENS = {"", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};
private final String[] THOUSANDS = {"", "Thousand", "Million", "Billion"};

public String numberToWords(int num) {
    if (num == 0) return "Zero";

    int i = 0;
    String words = "";
    
    while (num > 0) {
        if (num % 1000 != 0)
         words = helper(num % 1000) +THOUSANDS[i] + " " + words;
     num /= 1000;
     i++;
    }
    
    return words.trim();
}

private String helper(int num) {
    if (num == 0)
        return "";
    else if (num < 20)
        return LESS_THAN_20[num] + " ";
    else if (num < 100)
        return TENS[num / 10] + " " + helper(num % 10);
    else
        return LESS_THAN_20[num / 100] + " Hundred " + helper(num % 100);
}
    String[] digit = {"", " One", " Two", " Three", " Four", " Five",
            " Six", " Seven", " Eight", " Nine"};
    String[] tenDigit = {" Ten", " Eleven", " Twelve", " Thirteen", " Fourteen", " Fifteen",
            " Sixteen", " Seventeen", " Eighteen", " Nineteen"};
    String[] tenMutipleDigit = {"", "", " Twenty", " Thirty", " Forty", " Fifty",

            " Sixty", " Seventy", " Eighty", " Ninety"};
public String numberToWords(int num) {
    String[] bigs = new String[]{" Thousand", " Million", " Billion"};
    StringBuilder sb = new StringBuilder();
    int i = 0;
    sb.append(convertToWords(num % 1000));
    num /= 1000; // no need to first preprocess
    while (num > 0) {
        if (num % 1000 != 0) {
            sb.insert(0, convertToWords(num % 1000) + bigs[i]);
        }
        i++;
        num /= 1000;
    }
    return sb.length() == 0 ? "Zero" : sb.toString().trim();
}
public String convertToWords(int num) { //rename to like: threeDigitToWords
    StringBuilder sb = new StringBuilder();
    if (num >= 100) {
        sb.append(digit[num / 100]).append(" Hundred");
        num %= 100;
    }
    if (num > 9 && num < 20) {
        sb.append(tenDigit[num - 10]);
    } else {
        if (num >= 20) {
            sb.append(tenMutipleDigit[num / 10]);
            num %= 10;
        }
        sb.append(digit[num]);
    }
    return sb.toString();
}

    string translate(vector<string> &ones,vector<string> &oneTens,vector<string> &tens,vector<string> &ends,int nums,string end) {
        string rt = "";
        if (nums >= 100) {
            rt += ones[nums / 100 - 1] + " Hundred";
            nums %= 100;
        }
         
        if (nums >= 10) {
            if (rt != "") rt += " ";
            if (nums <= 19) {
                rt += oneTens[nums % 10];
                return rt + end;
            }
            rt += tens[nums / 10 - 2];
            nums %= 10;
        }
         
        if (nums >= 1) {
            if (rt != "") rt += " ";
            rt += ones[nums - 1];
        }
         
        return rt + end;
    }
    string numberToWords(int num) {
        if (num == 0) return "Zero";
        vector<string> ones = {"One","Two","Three","Four","Five","Six","Seven","Eight","Nine"};
        vector<string> oneTens = {"Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"};
        vector<string> tens = {"Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"};
        vector<string> ends = {" Billion"," Million"," Thousand",""};
         
        string rt = "";
        int temp = 0, endI = 0,bill = 1000000000;
        while (num > 0) {
            if (num / bill > 0) {
                if (rt != "") rt += " ";
                rt += translate(ones,oneTens,tens,ends,num / bill,ends[endI]);
            }
            num %= bill;
            bill /= 1000;
            endI++;
        }
        return rt;

    }
class Solution {
    unordered_map<int, string> hash;
public:
    Solution(){
        hash[0] = "Zero";
        hash[1] = "One";
        hash[2] = "Two";
        hash[3] = "Three";
        hash[4] = "Four";
        hash[5] = "Five";
        hash[6] = "Six";
        hash[7] = "Seven";
        hash[8] = "Eight";
        hash[9] = "Nine";
        hash[10] = "Ten";
        hash[11] = "Eleven";
        hash[12] = "Twelve";
        hash[13] = "Thirteen";
        hash[14] = "Fourteen";
        hash[15] = "Fifteen";
        hash[16] = "Sixteen";
        hash[17] = "Seventeen";
        hash[18] = "Eighteen";
        hash[19] = "Nineteen";
        hash[20] = "Twenty";
        hash[30] = "Thirty";
        hash[40] = "Forty";
        hash[50] = "Fifty";
        hash[60] = "Sixty";
        hash[70] = "Seventy";
        hash[80] = "Eighty";
        hash[90] = "Ninety";
    }
    string numberToWordsLessThousand(int num){
        if(!num) return hash[num];
        string s;
        if(num/100) s += hash[num/100] + " Hundred";
        num = num%100;
        if(num>=20){
            if(!s.empty()) s = s+" ";
            s += hash[num/10*10];
            num = num%10;
        }
        if(num){
            if(!s.empty()) s = s+" ";
            s += hash[num];
        }
        return s;
    }
    string numberToWords(int num) {
        if(!num) return hash[num];
        string s;
        if(num>=BILLION){
            int nb = num/BILLION;
            s += numberToWordsLessThousand(nb) + " Billion";
            num = num%BILLION;
        }
        if(num>=MILLION){
            if(!s.empty()) s = s+" ";
            int nm = num/MILLION;
            s += numberToWordsLessThousand(nm) + " Million";
            num = num%MILLION;
        }
        if(num>=THOUSAND){
            if(!s.empty()) s = s+" ";
            int nt = num/THOUSAND;
            s += numberToWordsLessThousand(nt) + " Thousand";
            num = num%THOUSAND;
        }
        if(num){
            if(!s.empty()) s = s+" ";
            s += numberToWordsLessThousand(num);
        }
        return s;
    }
};
http://likesky3.iteye.com/blog/2240465
  1.     public String numberToWords(int num) {  
  2.         if (num == 0return "Zero";  
  3.         StringBuilder result = new StringBuilder();  
  4.         boolean hasBillion = false;  
  5.         boolean hasMillion = false;  
  6.         boolean hasThousand = false;  
  7.         if (num >= 1000000000) {  
  8.             hasBillion = true;  
  9.             result.append(digits[num / 1000000000]).append(' ').append("Billion").append(' ');  
  10.             num %= 1000000000;  
  11.         }  
  12.         if (num >= 1000000) {  
  13.             hasMillion = true;  
  14.             result.append(readALessThousandNum(String.valueOf(num / 1000000), false)).append(' ').append("Million").append(' ');  
  15.             num %= 1000000;  
  16.         } /*else if (hasBillion && num > 0) { 
  17.             result.append("and").append(' '); 
  18.         }*/  
  19.         if (num >= 1000) {  
  20.             hasThousand = true;  
  21.             result.append(readALessThousandNum(String.valueOf(num / 1000), false)).append(' ').append("Thousand").append(' ');  
  22.             num %= 1000;  
  23.         } /*else if (hasMillion && num > 0) { 
  24.             result.append("and").append(' '); 
  25.         }*/  
  26.         result.append(readALessThousandNum(String.valueOf(num), hasThousand));  
  27.         return result.toString().trim();  
  28.     }  
  29.     private String[] digits = {"""One""Two""Three""Four""Five""Six""Seven""Eight""Nine"};  
  30.     private String[] tenx = {"Ten""Eleven""Twelve""Thirteen""Fourteen",   
  31.         "Fifteen""Sixteen""Seventeen","Eighteen""Nineteen"  
  32.     };  
  33.     private String[] tens = {"","","Twenty""Thirty""Forty""Fifty""Sixty""Seventy""Eighty""Ninety"};  
  34.     public String readALessThousandNum(String num, boolean hasThousand) {  
  35.         if (num.length() == 1)  
  36.             num = "00" + num;  
  37.         else if (num.length() == 2)  
  38.             num = "0" + num;  
  39.         StringBuilder result = new StringBuilder();  
  40.         boolean hasHundred = false;  
  41.         if (num.charAt(0) != '0') {  
  42.             hasHundred = true;  
  43.             result.append(digits[num.charAt(0) - '0']).append(' ').append("Hundred").append(' ');  
  44.         } /*else if (hasThousand && (num.charAt(1) != '0'|| num.charAt(0) != '0')) { 
  45.             result.append("and"); 
  46.         }*/  
  47.         if (num.charAt(1) == '0' && num.charAt(2) != '0') {  
  48.             // if ((hasHundred || hasThousand))  
  49.             //     result.append("and").append(' ');  
  50.             result.append(digits[num.charAt(2) - '0']).append(' ');  
  51.         } else if (num.charAt(1) == '1') {  
  52.             // if (hasHundred || hasThousand)  
  53.             //     result.append("and").append(' ');  
  54.             result.append(tenx[num.charAt(2) - '0']).append(' ');  
  55.         } else {  
  56.             result.append(tens[num.charAt(1) - '0']).append(' ');  
  57.             if (num.charAt(2) != '0')  
  58.                 result.append(digits[num.charAt(2) - '0']).append(' ');  
  59.         }  
  60.         return result.toString().trim();  
  61.     }  
http://bookshadow.com/weblog/2015/08/31/leetcode-integer-english-words/
class Solution(object): def numberToWords(self, num): to19 = 'One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve ' \ 'Thirteen Fourteen Fifteen Sixteen Seventeen Eighteen Nineteen'.split() tens = 'Twenty Thirty Forty Fifty Sixty Seventy Eighty Ninety'.split() def words(n): if n < 20: return to19[n-1:n] if n < 100: return [tens[n/10-2]] + words(n%10) if n < 1000: return [to19[n/100-1]] + ['Hundred'] + words(n%100) for p, w in enumerate(('Thousand', 'Million', 'Billion'), 1): if n < 1000**(p+1): return words(n/1000**p) + [w] + words(n%1000**p) return ' '.join(words(num)) or 'Zero'

def numberToWords(self, num): lv1 = "Zero One Two Three Four Five Six Seven Eight Nine Ten \ Eleven Twelve Thirteen Fourteen Fifteen Sixteen Seventeen Eighteen Nineteen".split() lv2 = "Twenty Thirty Forty Fifty Sixty Seventy Eighty Ninety".split() lv3 = "Hundred" lv4 = "Thousand Million Billion".split() words, digits = [], 0 while num: token, num = num % 1000, num / 1000 word = '' if token > 99: word += lv1[token / 100] + ' ' + lv3 + ' ' token %= 100 if token > 19: word += lv2[token / 10 - 2] + ' ' token %= 10 if token > 0: word += lv1[token] + ' ' word = word.strip() if word: word += ' ' + lv4[digits - 1] if digits else '' words += word, digits += 1 return ' '.join(words[::-1]) or 'Zero'
Read full article from LIKE CODING: LeetCode [273] Integer to English Words

Labels

LeetCode (1432) GeeksforGeeks (1122) LeetCode - Review (1067) Review (882) Algorithm (668) to-do (609) Classic Algorithm (270) Google Interview (237) Classic Interview (222) Dynamic Programming (220) DP (186) Bit Algorithms (145) POJ (141) Math (137) Tree (132) LeetCode - Phone (129) EPI (122) Cracking Coding Interview (119) DFS (115) Difficult Algorithm (115) Lintcode (115) Different Solutions (110) Smart Algorithm (104) Binary Search (96) BFS (91) HackerRank (90) Binary Tree (86) Hard (79) Two Pointers (78) Stack (76) Company-Facebook (75) BST (72) Graph Algorithm (72) Time Complexity (69) Greedy Algorithm (68) Interval (63) Company - Google (62) Geometry Algorithm (61) Interview Corner (61) LeetCode - Extended (61) Union-Find (60) Trie (58) Advanced Data Structure (56) List (56) Priority Queue (53) Codility (52) ComProGuide (50) LeetCode Hard (50) Matrix (50) Bisection (48) Segment Tree (48) Sliding Window (48) USACO (46) Space Optimization (45) Company-Airbnb (41) Greedy (41) Mathematical Algorithm (41) Tree - Post-Order (41) ACM-ICPC (40) Algorithm Interview (40) Data Structure Design (40) Graph (40) Backtracking (39) Data Structure (39) Jobdu (39) Random (39) Codeforces (38) Knapsack (38) LeetCode - DP (38) Recursive Algorithm (38) String Algorithm (38) TopCoder (38) Sort (37) Introduction to Algorithms (36) Pre-Sort (36) Beauty of Programming (35) Must Known (34) Binary Search Tree (33) Follow Up (33) prismoskills (33) Palindrome (32) Permutation (31) Array (30) Google Code Jam (30) HDU (30) Array O(N) (29) Logic Thinking (29) Monotonic Stack (29) Puzzles (29) Code - Detail (27) Company-Zenefits (27) Microsoft 100 - July (27) Queue (27) Binary Indexed Trees (26) TreeMap (26) to-do-must (26) 1point3acres (25) GeeksQuiz (25) Merge Sort (25) Reverse Thinking (25) hihocoder (25) Company - LinkedIn (24) Hash (24) High Frequency (24) Summary (24) Divide and Conquer (23) Proof (23) Game Theory (22) Topological Sort (22) Lintcode - Review (21) Tree - Modification (21) Algorithm Game (20) CareerCup (20) Company - Twitter (20) DFS + Review (20) DP - Relation (20) Brain Teaser (19) DP - Tree (19) Left and Right Array (19) O(N) (19) Sweep Line (19) UVA (19) DP - Bit Masking (18) LeetCode - Thinking (18) KMP (17) LeetCode - TODO (17) Probabilities (17) Simulation (17) String Search (17) Codercareer (16) Company-Uber (16) Iterator (16) Number (16) O(1) Space (16) Shortest Path (16) itint5 (16) DFS+Cache (15) Dijkstra (15) Euclidean GCD (15) Heap (15) LeetCode - Hard (15) Majority (15) Number Theory (15) Rolling Hash (15) Tree Traversal (15) Brute Force (14) Bucket Sort (14) DP - Knapsack (14) DP - Probability (14) Difficult (14) Fast Power Algorithm (14) Pattern (14) Prefix Sum (14) TreeSet (14) Algorithm Videos (13) Amazon Interview (13) Basic Algorithm (13) Codechef (13) Combination (13) Computational Geometry (13) DP - Digit (13) LCA (13) LeetCode - DFS (13) Linked List (13) Long Increasing Sequence(LIS) (13) Math-Divisible (13) Reservoir Sampling (13) mitbbs (13) Algorithm - How To (12) Company - Microsoft (12) DP - Interval (12) DP - Multiple Relation (12) DP - Relation Optimization (12) LeetCode - Classic (12) Level Order Traversal (12) Prime (12) Pruning (12) Reconstruct Tree (12) Thinking (12) X Sum (12) AOJ (11) Bit Mask (11) Company-Snapchat (11) DP - Space Optimization (11) Dequeue (11) Graph DFS (11) MinMax (11) Miscs (11) Princeton (11) Quick Sort (11) Stack - Tree (11) 尺取法 (11) 挑战程序设计竞赛 (11) Coin Change (10) DFS+Backtracking (10) Facebook Hacker Cup (10) Fast Slow Pointers (10) HackerRank Easy (10) Interval Tree (10) Limited Range (10) Matrix - Traverse (10) Monotone Queue (10) SPOJ (10) Starting Point (10) States (10) Stock (10) Theory (10) Tutorialhorizon (10) Kadane - Extended (9) Mathblog (9) Max-Min Flow (9) Maze (9) Median (9) O(32N) (9) Quick Select (9) Stack Overflow (9) System Design (9) Tree - Conversion (9) Use XOR (9) Book Notes (8) Company-Amazon (8) DFS+BFS (8) DP - States (8) Expression (8) Longest Common Subsequence(LCS) (8) One Pass (8) Quadtrees (8) Traversal Once (8) Trie - Suffix (8) 穷竭搜索 (8) Algorithm Problem List (7) All Sub (7) Catalan Number (7) Cycle (7) DP - Cases (7) Facebook Interview (7) Fibonacci Numbers (7) Flood fill (7) Game Nim (7) Graph BFS (7) HackerRank Difficult (7) Hackerearth (7) Inversion (7) Kadane’s Algorithm (7) Manacher (7) Morris Traversal (7) Multiple Data Structures (7) Normalized Key (7) O(XN) (7) Radix Sort (7) Recursion (7) Sampling (7) Suffix Array (7) Tech-Queries (7) Tree - Serialization (7) Tree DP (7) Trie - Bit (7) 蓝桥杯 (7) Algorithm - Brain Teaser (6) BFS - Priority Queue (6) BFS - Unusual (6) Classic Data Structure Impl (6) DP - 2D (6) DP - Monotone Queue (6) DP - Unusual (6) DP-Space Optimization (6) Dutch Flag (6) How To (6) Interviewstreet (6) Knapsack - MultiplePack (6) Local MinMax (6) MST (6) Minimum Spanning Tree (6) Number - Reach (6) Parentheses (6) Pre-Sum (6) Probability (6) Programming Pearls (6) Rabin-Karp (6) Reverse (6) Scan from right (6) Schedule (6) Stream (6) Subset Sum (6) TSP (6) Xpost (6) n00tc0d3r (6) reddit (6) AI (5) Abbreviation (5) Anagram (5) Art Of Programming-July (5) Assumption (5) Bellman Ford (5) Big Data (5) Code - Solid (5) Code Kata (5) Codility-lessons (5) Coding (5) Company - WMware (5) Convex Hull (5) Crazyforcode (5) DFS - Multiple (5) DFS+DP (5) DP - Multi-Dimension (5) DP-Multiple Relation (5) Eulerian Cycle (5) Graph - Unusual (5) Graph Cycle (5) Hash Strategy (5) Immutability (5) Java (5) LogN (5) Manhattan Distance (5) Matrix Chain Multiplication (5) N Queens (5) Pre-Sort: Index (5) Quick Partition (5) Quora (5) Randomized Algorithms (5) Resources (5) Robot (5) SPFA(Shortest Path Faster Algorithm) (5) Shuffle (5) Sieve of Eratosthenes (5) Strongly Connected Components (5) Subarray Sum (5) Sudoku (5) Suffix Tree (5) Swap (5) Threaded (5) Tree - Creation (5) Warshall Floyd (5) Word Search (5) jiuzhang (5)

Popular Posts