美文网首页Princeton Algorithm Part 1
Princeton Algorithm Part 1 week

Princeton Algorithm Part 1 week

作者: 超級超限 | 来源:发表于2017-07-13 23:12 被阅读25次

上课重点记一下:

assert = 程序运行到此该Boolean为true方能继续
• Statement to test assumptions about your program;
- Helps detect logic bugs
- Documents code

Java assert statement. Throws exception unless Boolean condition is true.
assert isSorted(a, lo, hi ;
Can enable or disable at run time. No cost in production code.
java -ea MyProgram //enable assertions
java -da MyProgram //disable assertions (default)

comparable:
comparator:

degenerate line segment == point;

相关文章

网友评论

    本文标题:Princeton Algorithm Part 1 week

    本文链接:https://www.haomeiwen.com/subject/csgghxtx.html