1 Star 1 Fork 0

kenthan/algorithm-helloworld

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
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文件

空文件

简介

《算法》第四版作业:https://coursera.cs.princeton.edu/algs4/assignments/hello/specification.php 展开 收起
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kenthan/algorithm-helloworld.git
git@gitee.com:kenthan/algorithm-helloworld.git
kenthan
algorithm-helloworld
algorithm-helloworld
master

搜索帮助