Purely Functional Data Structures

Purely Functional Data Structures

作者:Chris Okasaki

出版社:Cambridge University Press

出版年:1999-6-13

评分:9.3

ISBN:9780521663502

所属分类:行业好书

书刊介绍

内容简介

Most books on data structures assume an imperative language such as C or C++.However, data structures for these languages do not always translate well to functional languages such as Standard ML, Haskell, or Scheme.This book describes data structures from the point of view of functional languages, with examples, and presents design techniques that allow programmers to develop their own functional data structures.The author includes both classical data structures, such as red-black trees and binomial queues, and a host of new data structures developed exclusively for functional languages.All source code is given in Standard ML and Haskell, and most of the programs are easily adaptable to other functional languages. This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study.

作品目录

1. Introduction
2. Persistence
3. Some familiar data structures in a functional setting
4. Lazy evaluation
5. Fundamentals of amortization
6. Amortization and persistence via lazy evaluation
7. Eliminating amortization
8. Lazy rebuilding
9. Numerical representations
10. Data-structural bootstrapping
11. Implicit recursive slowdown
Appendix: Haskell source code
· · · · · ·

作者简介

Dr. Okasaki spent three years at Columbia University as an Assistant Professor of Computer Science, where he taught courses in programming languages and advanced data structures. He has also worked as a visiting researcher at the University of Glasgow, and as a consultant for an Internet startup company, developing a compiler for their agent control language. His primary resear...

(展开全部)

精彩摘录

funinsert(x,s)=letfuninsE=T(R,E,x,E)|ins(sasT(color,a,y,b)=ifxythenbalance(color,a,y,insb)elsesvalT(_,a,y,b)=inss(*guaranteedtobenon-empty*)inT(B,a,y,b)end

——引自第33页


funbalance((B,T(R,T(R,a,x,b),y,c),z,d)|(B,T(R,a,x,T(R,b,y,c)),z,d)|(B,a,x,T(R,T(R,b,y,c),z,d)|(B,a,x,T(A,b,y,T(R,c,z,d))))=T(R,T(B,a,x,b),y,T(B,c,z,d))|balancebody=Tbody

——引自第33页

相关推荐

微信二维码