Giter VIP home page Giter VIP logo

algorithms's Introduction

算法(第四版)

书本自带的版本库在 std.lib 下,这是解压的 stdlib.jar 源码,你也可以直接将 lib/stdlib.jar 加入到 library 中去。 数据集下载:http://algs4.cs.princeton.edu/code/algs4-data.zip

重定向与管道

如果想要运行书中的命令,那么进入 lib 目录中,然后

java -Djava.ext.dirs=. RandomSeq 1000 100.0 200.0 > data.txt

这样就会在当前lib下生成一个包含 100 到 200 之间的随机数文件。

平均数

java -Djava.ext.dirs=. Average < data.txt
--------结果分割线
Average is 150.27822999999998

管道

java -Djava.ext.dirs=. RandomSeq 1000 100.0 200.0 | java -Djava.ext.dirs=. Average
--------结果分割线
Average is 149.16858000000005

查找

  1. 二分查找

排序

algorithms's People

Contributors

leongfeng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.