Java
文章平均质量分 80
williamcs
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Sudoku backtracking with one dimension array
package hello.test;import java.io.*;import java.util.*;public class Sudoku { private static final int N = 9; // the size of the board private int[] board; // the one dimension array原创 2012-11-27 14:47:00 · 813 阅读 · 0 评论 -
Merge Sort and apply it to an interview question
Merge Sort is very efficient in sorting a list of elements with O(nlgn) complexity. It is used with divide and conquer strategy.A few days ago, I came to an interview question, the description o原创 2013-08-17 10:38:48 · 935 阅读 · 0 评论 -
Implement a spell checker with java
When you typing a word, many systems will suggest many words for you to select the word which you intend to type. This is spell checker.It will calculate the edit distance between a dictionary. Ever原创 2013-05-04 16:54:07 · 908 阅读 · 0 评论 -
Longest common subsequence problem and poj 1159 Palindrome
The longest common subsequence problem is a very basic problem in dynamic programming. If you dive in,there is manyothermethods to compute thelongest common subsequence. Hereis just the very basic原创 2013-04-24 12:40:18 · 819 阅读 · 0 评论 -
Parallel array summation
C++ code:#include #include #include #define NUM_THREADS 4int N;int *X;int gSum[NUM_THREADS];//pthread_mutex_t sum_mutex = PTHREAD_MUTEX_INITIALIZER;// do sumvoid *summation(void *p原创 2013-02-13 21:45:49 · 552 阅读 · 0 评论 -
QuickSort two way, three way partition and many other implementations
Quicksort is so famous which was honored as one of the top 10 algorithms of 20th century in science and engineer. It is use thedivide and conquer strategy. Divde the array into two subarray and recu原创 2013-01-08 15:19:26 · 3656 阅读 · 0 评论 -
Missionaries and Cannibals problem breadth first search implementation
Problem description: Three missionaries and cannibals want to cross the river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionries p原创 2012-12-15 13:56:43 · 4557 阅读 · 0 评论 -
Levenshtein's eidit distance
From Wiki, the definition of Levenshtein distance is astring metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is equal to the numb原创 2012-11-24 12:06:16 · 588 阅读 · 0 评论 -
Simple T9 implementation with Trie
package hello.test;import java.io.*;import java.util.LinkedList;import java.util.Queue;public class Trie { private final int R = 26; // the trie branches private Node root = new N原创 2012-12-07 11:03:53 · 3212 阅读 · 1 评论 -
Disjoint set and poj 1611
package hello.test;import java.io.File;import java.io.FileNotFoundException;import java.util.Scanner;public class DisjointSet { private final static int DEFAULT_SIZE = 10; private in原创 2012-11-30 17:20:56 · 730 阅读 · 0 评论 -
Find the kth largest element in an unsorted array
This is should be an old problem, I had written some code long time ago. This time I just write some code for review. The idea is the same as quick sort. There are many other methods too, but this met原创 2016-03-11 22:30:00 · 749 阅读 · 0 评论
分享