Skip to Content
算法技术手册(原书第2 版)
book

算法技术手册(原书第2 版)

by George T.Heineman, Gary Pollice, Stanley Selkow
August 2017
Intermediate to advanced
360 pages
8h 35m
Chinese
China Machine Press
Content preview from 算法技术手册(原书第2 版)
算法基础
43
算法基础
3
-
4
:特殊的 IEEE
754
特殊值
64
IEEE
754
表示
正无穷
0x7ff0000000000000L
负无穷
0x7ff0000000000000L
非数
NaN
0x7ff0000000000001L
0x7fffffffffffffffL
以及
0xfff0000000000001L
0xffffffffffffffffL
负零
0x8000000000000000
正零
0x0000000000000000
这些特殊值是异常发生时返回的结果。例如,正无穷在
Java
中会作为
double
x=1/0.0
的结果。但有趣的是,如果这个表达式换成
double
x=1/0
Java
虚拟机将会抛出
ArithmeticException
异常,因为这个表达式是计算两个整数而不是浮点数的除法。
3.5 算法举例
我们将通过
Graham
扫描算法来介绍本书的算法模板。算法可以用于计算二维空间上
给定点集的凸包(第
1
章已经介绍过这个问题,并在图
1-3
中予以说明)。
3.5.1 算法名称和摘要
Graham
扫描算法可以计算出笛卡空间给定点集的凸包。它首先会寻找输入
P
中的
最低点
low
,然后将剩下的点
{
P
-
low
}
按照和
low
的极角从大到小排序。之后算法会按
序遍历这些点构建凸包,如果凸包上最新的三个点构成一个左拐,那么最新加入的点就
需要被删除掉。
3.5.2 输入 / 输出
凸包问题实例由一个点集
P
定义。
输出是一系列的(
x
,
y
点,即顺时针输出凸包上的点。哪个点在最前面并不重要。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

Aurélien Géron
Go语言编程

Go语言编程

威廉·肯尼迪

Publisher Resources

ISBN: 9787111562221