{"id":776,"date":"2009-05-28T10:28:05","date_gmt":"2009-05-28T10:28:05","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2009\/05\/28\/finger-tree-update-i-forgot-something\/"},"modified":"2009-05-28T10:28:05","modified_gmt":"2009-05-28T10:28:05","slug":"finger-tree-update-i-forgot-something","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2009\/05\/28\/finger-tree-update-i-forgot-something\/","title":{"rendered":"Finger Tree Update: I forgot something"},"content":{"rendered":"<p> As an alert commenter pointed out, I left out one really important thing in<br \/>\nmy earlier post about finger trees. That&#8217;s what I get for trying to write when<br \/>\nI&#8217;m sick :-). Seriously, this is a point that&#8217;s implied by the post as it stands, but never explicitly stated &#8211; and since it&#8217;s really important, it<br \/>\nshould be stated explicitly.<\/p>\n<p> The monoid-annotated tree structure doesn&#8217;t <em>replace<\/em> the original<br \/>\ndata structure: it&#8217;s superimposed on it.<\/p>\n<p> So, as I said: cons-cell style lists are ubiquitous and beloved by<br \/>\nfunctional and non-functional programmers. In finger trees, you&#8217;re<br \/>\n<em>not<\/em> getting rid of them. The point of finger trees is to let<br \/>\nyou <em>keep<\/em> the convenient data structure, with its basic operations<br \/>\nand properties intact, and to <em>augment<\/em> it with a tree that lets you search it efficiently.<\/p>\n<p> To illustrate: here&#8217;s the number list example from yesterdays post. The<br \/>\noriginal list is at the bottom, with green pointers representing the<br \/>\noriginal cons-list next-pointers. The monoid-annotated tree is on top,<br \/>\nwith red pointers. The combination of the original list with the<br \/>\nmonoid annotated tree is a finger tree.<\/p>\n<div><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_388.png?resize=546%2C278\" width=\"546\" height=\"278\" alt=\"counted-finger-tree-list.png\" \/><\/div>\n<p> The point of this is that you&#8217;ve still got your cons list. All of the<br \/>\nbeautiful recursive\/iterative algorithms that walk the list continue to<br \/>\nwork <em>exactly<\/em> the way that they would in the traditional cons-list: for code that walks the list, the fact that there are finger-tree pointers<br \/>\nsitting on top of the list is irrelevant &#8211; and, in fact, completely invisible. For algorithms that want to search the list, the tree structure is there,<br \/>\nand allows the searches to be performed much more quickly than they could be on<br \/>\nthe traditional list. The superposition of those two structures is the<br \/>\ngenius of the finger tree.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an alert commenter pointed out, I left out one really important thing in my earlier post about finger trees. That&#8217;s what I get for trying to write when I&#8217;m sick :-). Seriously, this is a point that&#8217;s implied by the post as it stands, but never explicitly stated &#8211; and since it&#8217;s really important, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[83,35],"tags":[],"class_list":["post-776","post","type-post","status-publish","format-standard","hentry","category-data-structures","category-markccs-errors"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-cw","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}