http://staff.city.ac.uk/~ross/papers/FingerTree.html

Summary

We present 2-3 finger trees, a functional representation of persistent sequences supporting access to the ends in amortized constant time, and concatenation and splitting in time logarithmic in the size of the smaller piece. Representations achieving these bounds have appeared previously, but 2-3 finger trees are much simpler, as are the operations on them. Further, by defining the split operation in a general form, we obtain a general purpose data structure that can serve as a sequence, priority queue, search tree, priority search queue and more.

The basic structure is expressed as a non-regular (or nested) type:

data FingerTree a = Empty
| Single a
| Deep (Digit a) (FingerTree (Node a)) (Digit a) data Digit a = One a | Two a a | Three a a a | Four a a a a
data Node a = Node2 a a | Node3 a a a

This produces trees of 2-3 trees, with favoured access (fingers) at the ends, like

(more examples) and also supports efficient concatenation. To support splitting and searching, we annotate the internal nodes of the tree with values drawn from an application-specific monoid.

Finger Trees: A Simple General-purpose Data Structure的更多相关文章

  1. General Purpose Hash Function Algorithms

    General Purpose Hash Function Algorithms post@: http://www.partow.net/programming/hashfunctions/inde ...

  2. 转:Monoids and Finger Trees

    转自:http://apfelmus.nfshost.com/articles/monoid-fingertree.html This post grew out of the big monoid ...

  3. However, a general purpose protocol or its implementation sometimes does not scale very well.

    https://netty.io/wiki/user-guide-for-4.x.html The Problem Nowadays we use general purpose applicatio ...

  4. [Algorithm] Heap data structure and heap sort algorithm

    Source, git Heap is a data structure that can fundamentally change the performance of fairly common ...

  5. Mesh Data Structure in OpenCascade

    Mesh Data Structure in OpenCascade eryar@163.com 摘要Abstract:本文对网格数据结构作简要介绍,并结合使用OpenCascade中的数据结构,将网 ...

  6. hdu-5929 Basic Data Structure(双端队列+模拟)

    题目链接: Basic Data Structure Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 65536/65536 K (Ja ...

  7. HDU 5929 Basic Data Structure 模拟

    Basic Data Structure Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

  8. CDOJ 483 Data Structure Problem DFS

    Data Structure Problem Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/proble ...

  9. HDU 5929 Basic Data Structure 【模拟】 (2016CCPC东北地区大学生程序设计竞赛)

    Basic Data Structure Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

随机推荐

  1. kettle系列-5.kettle实现二进制文件迁移

    本文就是分享下二进制文件(图片.txt文件等)在oracle和文件系统间的传输的转换示例. 转换示例如下图: 示例本身较简单,但很多人应该还是不太清楚怎么做,很多时候都是上网搜索,网上有关的就是通过j ...

  2. 弹出层提示,X秒后关闭

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD ...

  3. Notepad++正则表达式语法

    \   转义字符  如:要使用 “\” 本身, 则应该使用“\\” \t  Tab制表符  注:扩展和正则表达式都支持 \r  回车符CR   注:扩展支持,正则表达式不支持 \n  换行符LF   ...

  4. 一次mongodb 统计需求

    需求: 临下班运营的同事发来了一个需求,要统计数据库里某个collection的所有document 中某个字段(_id)出现的次数._id 字段的范围是0-4000. 假设collection 是这 ...

  5. HDU5988 Coding Contest(费用流)

    2016青岛现场赛的一题,由于第一次走过不会产生影响,需要拆点,不过比赛时没想到,此外还有许多细节要注意,如要加eps,时间卡得较紧要注意细节优化等 #include <iostream> ...

  6. F#之旅2 - 我有特别的学F#技巧

    原文地址:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/learning-fsharp/ Learning F#Functio ...

  7. hash表及Java中的HashMap与HashSet

    链接: http://alex09.iteye.com/blog/539545/ 当程序试图将一个 key-value 对放入 HashMap 中时,程序首先根据该 key 的 hashCode() ...

  8. [翻译]Telnet简单介绍及在windows 7中开启Telnet客户端

    文章翻译自 http://social.technet.microsoft.com/wiki/contents/articles/910.windows-7-enabling-telnet-clien ...

  9. Daily Scrum Meeting ——FourthDay(Beta)12.12

    一.Daily Scrum Meeting照片 讨论界面优化详情 二.Burndown Chart 项目有条不紊地进行中... 1.新增6个界面修改计划 2.修复两个BUG 三.项目进展(check- ...

  10. SparkLauncher 1.6 版本bug

    背景 近期在研究使用java api的方式来调用Spark程序,通过句柄的方式来完成监控Job运行状态.及时杀死Job等功能.官方文档直接指出使用Java/Scala创建Job的方式——利用Spark ...