# algorithm-helloworld **Repository Path**: kenthan/algorithm-helloworld ## Basic Information - **Project Name**: algorithm-helloworld - **Description**: 《算法》第四版作业:https://coursera.cs.princeton.edu/algs4/assignments/hello/specification.php - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-06-13 - **Last Updated**: 2022-03-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Coursera Algorithms Part 1 Hello World 练习答案 Submit a zip file named hello.zip that contains only the three source files HelloWorld.java, HelloGoodbye.java, and RandomWord.java. Using algs4.jar. Under construction. Write a program RandomWord.java that reads a sequence of words from standard input and prints one of those words uniformly at random. Do not store the words in an array or list. Instead, use Knuth’s method: when reading the ith word, select it with probability 1/i to be the champion, replacing the previous champion. After reading all of the words, print the surviving champion. 100% 满分解答,第三题见`RandomWord.java`文件