Okasaki thesis

Partially persistent[ edit ] In the partial persistence model, we may query any previous version of the data structure, but we may only update the latest version.

Okasaki thesis

Okasaki thesis persistent[ edit ] In the partial persistence model, we may query any previous version of the data structure, but we may only update the latest version. This implies a linear ordering among the versions. Fat node[ edit ] Fat node method is to record all changes made to node fields in the nodes themselves, without erasing old values of the fields.

In other words, each fat node contains the same information and pointer fields as an ephemeral node, along with space for an arbitrary number of extra field values. Each extra field value has an associated field name and a version stamp which indicates the version in which the named field was changed to have the specified value.

Besides, each fat node has its own version stamp, indicating the version in which the node was created. The only purpose of nodes having version stamps is to make sure that each node only contains one value per field name per version.

In order to navigate through the structure, each original field value in a node has a version stamp of zero. Complexity of fat node[ edit ] With using fat node method, it requires O 1 space for every modification: Each modification takes O 1 additional time to store the modification at the end of the modification history.

This is an amortized time bound, assuming we store the modification history in a growable array. For access timewe must find the right version at each node as we traverse the structure.

If we made m modifications, then each access operation has O log m slowdown resulting from the cost of finding the nearest modification in the array. Path copying[ edit ] Path copy is to make a copy of all nodes on the path which contains the node we are about to insert or delete.

Then we must cascade the change back through the data structure: These modifications cause more cascading changes, and so on, until we reach to the root.

We maintain an array of roots indexed by timestamp. Complexity of path copying[ edit ] With m modifications, this costs O log m additive lookup time.

Modification time and space are bounded by the size of the structure, since a single modification may cause the entire structure to be copied.

A combination[ edit ] SleatorTarjan et al. In each node, we store one modification box. Whenever we access a node, we check the modification box, and compare its timestamp against the access time. The access time specifies the version of the data structure that we care about.In this chapter, we'll make use of the image parsing library we developed in Chapter 10, Code case study: parsing a binary data format to build a barcode recognition application.

Given a picture of the back of a book taken with a camera phone, we could use this to extract its ISBN number. User Review - Flag as inappropriate This is a great book.

An improved version of Okasaki's PhD thesis, the book introduces the reader to the notion of efficient data structures which still get to be purely functional (i.e.

not imperative, no side-effects).

A little bit about barcodes

A common problem with purely functional data structures is that, since there is no state, 4/5(5). Chris Okasaki's thesis was published long before either of those languages were developed, and studied closely by programmers across a great variety of functional languages such as Haskell, the MLs (all examples in the thesis are in Haskell and SML), surely CLISP coders, Erlang, and any other language you can figure has an interest in.

Okasaki thesis

Also, if you play board games, auction theory explains why fixing game imbalance via an auction mechanism is non-trivial and often makes the game worse. In computer science, a purely functional data structure is a data structure that can be implemented in a purely functional language.

Chapter 1 Barcode recognition

The main difference between an arbitrary data structure and a purely functional one is that the latter is (strongly) immutable. Colin Okasaki Harvey Mudd College high-use environments have on the time-to-outbreak for antibiotic resistance.

Model To explore this problem we built a compartmental ODE model. We group in- Thanks also to the HMC Math Department for guiding me through this thesis.

Okasaki thesis
Purely Functional Data Structures – Okasaki (PDF) : programming