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.io.*; | |
import java.util.*; | |
public class wordcount | |
{ | |
public static class Word implements Comparable<Word> | |
{ | |
String word; | |
int count; |
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
---------------------- | |
Fisher–Yates shuffle | |
---------------------- | |
* Fisher and Yates' original method | |
1. Write down the numbers from 1 to N. | |
2. Pick a random number k between one and the number of unstruck numbers remaining (inclusive). | |
3. Counting from the low end, strike out the kth number not yet struck out, and write it down elsewhere. | |
4. Repeat from step 2 until all the numbers have been struck out. |
NewerOlder