[{"data":1,"prerenderedAt":508},["ShallowReactive",2],{"project-20872696":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":45,"post_text":46,"what":47,"said":71,"maker_in_thread":180,"shape":192,"grid":196,"attempts":469,"same_week":470,"maker_shows":238,"maker_hidden":500,"reader_version":501,"card":502},"20872696","IgushArray","Array with Constant Time Access and Fast Insertion and Deletion","title","Show HN: Array with Constant Time Access and Fast Insertion and Deletion","https:\u002F\u002Fgithub.com\u002Figushev\u002FIgushArray","github.com","igushev",1567555812,2019,300,103,100,2195,5,"legend","languages","data structure library","library",[24,25,26,27],"tiered vector","constant time access","sqrt decomposition","c++ vector","curious",-0.253,{"positive":31,"neutral":32,"mixed":31,"critical":33},4,30,20,58,{"idea":36,"docs":39,"performance":42,"execution":44},{"positive":37,"critical":38},1,6,{"positive":40,"critical":41},0,3,{"positive":37,"critical":43},8,{"positive":37,"critical":41},[41,41,37,41,41,41,41,37,37,41,37,40,18,18,41,41,37,41,40,41,41,37,40,18,37,37,37,37,37,41,37,41,40,40,37,37,37,41,37,37],null,{"problem":48,"audience":46,"pricing":46,"motivation":46,"time_to_build":46,"stack":56,"openness":69,"stage":70,"team_size":70},{"value":49,"source":50,"evidence":51},"Vector with constant-time indexing but faster middle insertion and deletion than std::vector","commenter",[52],{"id":53,"by":54,"text":55},"20873581","malisper","For those reading along, the post describes a vector-like datastructure that has O(1) access time and O(sqrt(N)) insert and deletion time at an arbitrary index. The idea is…",[57],{"value":58,"source":59,"evidence":60},"C++","inferred",[61,65],{"id":62,"by":63,"text":64},"20873088","michaelrpeskin","Is there a reason you didn’t just use std::deque? You’re already in C++.",{"id":66,"by":67,"text":68},"20877757","mises","Side-question: is there any way to explicitly tell github whether a file is C or C++? I have this same issue, where C code is marked as C++ and vice-versa. Not a huge issue, but…","open_source","unknown",{"praise":72,"objections":81,"requests":111,"questions":134,"alternatives":153},[73],{"value":74,"source":50,"evidence":75},"Clever idea and a neat restructuring of the vector",[76,77],{"id":53,"by":54,"text":55},{"id":78,"by":79,"text":80},"20872915","juliusmusseau","I think the data-structure is careful to make sure the main array is at most SQRT(N) and all linked queues also SQRT(N). It's a neat restructuring of the vector into a SQRT(N) *…",[82,90,97,101],{"value":83,"source":50,"evidence":84},"Insertion cost O(sqrt N) is still much slower than O(log N) trees",[85,86],{"id":53,"by":54,"text":55},{"id":87,"by":88,"text":89},"20874191","kccqzy","Doesn't really seem much better than just a balanced size-tagged binary tree. You get O(log n) access, insertion, and deletion. Yes access is slower but insertion and deletion is…",{"value":91,"source":50,"evidence":92},"Benchmarks could be stronger (variance, warm cache, payload types)",[93],{"id":94,"by":95,"text":96},"20874414","birdbrain","I don't want to detract from the cleverness here, but I believe your benchmarks could use some work. Here are a few suggestions: 1. Simply testing something 1000 times and…",{"value":98,"source":50,"evidence":99},"Name uses the author's own name",[100],{"id":53,"by":54,"text":55},{"value":102,"source":103,"evidence":104},"Needs fixed size known in advance; no automatic restructuring yet","maker",[105,108],{"id":106,"by":11,"text":107},"20874436","I also need to add automatic restructuring when it expands or shrinks significantly.",{"id":109,"by":11,"text":110},"20879200","Yes, the structure is sensitive for that and benefits a lot from using reserve(). I need to add automatic restructuring to maintain perfect k.",[112,127],{"value":113,"source":50,"evidence":114},"Benchmarks against std::deque, std::list and trees",[115,119,123],{"id":116,"by":117,"text":118},"20876374","temac","Can you also benchmark against std::deque?",{"id":120,"by":121,"text":122},"20885820","bnolsen","The performance numbers would be most interesting if he benchmarked against std::vector, std::list, std::multiset and std::deque just to see how it compares to all the major…",{"id":124,"by":125,"text":126},"20878730","detrino","Re benchmarking vs other data structures: Here is a B+Tree based sequence container I made: https:\u002F\u002Fgithub.com\u002Fdet\u002Fsegmented_tree Basically, it has O(log n) everything like a…",{"value":128,"source":103,"evidence":129},"Automatic restructuring on growth and shrink",[130,131],{"id":106,"by":11,"text":107},{"id":132,"by":11,"text":133},"20879169","It seems I need to add automatic restructuring to the structure, so it would maintain perfect lengths of DEQs",[135,142],{"value":136,"source":50,"evidence":137},"Why hasn't this been done before, and what are the trade-offs",[138],{"id":139,"by":140,"text":141},"20873934","not_kurt_godel","My somewhat naïve question is: if indeed this is an objectively superior data structure as claimed, why hasn't anyone else thought of it before in the history of computer…",{"value":143,"source":50,"evidence":144},"How it differs from ropes or std::deque",[145,149],{"id":146,"by":147,"text":148},"20896702","piccolbo","How is that different from a rope data structure?",{"id":150,"by":151,"text":152},"20873098","asdfasgasdgasdg","This is very similar to what std::deque does under the covers already. It's a chunked array. The main difference AFAICT from std::deque is that this offers n^1\u002F2 insertion and…",[154,162,170,174],{"value":155,"source":50,"evidence":156},"Tiered vectors (Goodrich and Kornerup paper)",[157,161],{"id":158,"by":159,"text":160},"20873110","immawizard","I believe this data structure is called Tiered vectors, and is described in: https:\u002F\u002Fwww.ics.uci.edu\u002F~goodrich\u002Fpubs\u002Fwads99.pdf",{"id":53,"by":54,"text":55},{"value":163,"source":50,"evidence":164},"Skip lists and balanced binary trees",[165,169],{"id":166,"by":167,"text":168},"20875202","Labo333","All of those operations are achievable when replacing sqrt with log by using Skip lists (https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSkip_list), and probably with Zip trees as well…",{"id":87,"by":88,"text":89},{"value":171,"source":50,"evidence":172},"std::deque",[173],{"id":150,"by":151,"text":152},{"value":175,"source":50,"evidence":176},"Ropes",[177],{"id":178,"by":147,"text":179},"20896754","sqrt(N) can be described as \"fast\" only with significant amounts of spin added. Use ropes instead. https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRope_(data_structure)",{"comments":181,"answered":18,"key":182},18,[183,186,189],{"id":184,"text":185},"20873737","Thanks for feedback! Any naming suggestions? :-)",{"id":187,"text":188},"20873122","I need to read the paper, but on high-level looks indeed similar.",{"id":190,"text":191},"20874425","Thanks for feedback!",{"commenters":193,"max_depth":38,"maker_replies":181,"first_comment_mins":194,"lifespan_hours":195},56,33,145,[197,199,201,205,208,211,215,218,222,225,228,229,230,232,234,235,237,240,242,246,249,253,256,258,262,265,268,270,273,276,279,281,282,284,287,289,292,294,295,297,299,301,305,307,309,311,313,316,319,321,323,326,327,331,335,339,341,344,346,348,352,355,357,359,361,363,365,367,371,373,375,377,379,383,384,387,389,393,396,399,402,404,408,412,415,418,421,424,427,429,433,435,440,444,448,450,453,455,457,460,462,464,466],[53,40,41,198,54,40],"project\u002Fmixed\u002Fidea",[184,40,40,200,11,37],"maker\u002Fneutral\u002Fnone",[202,40,41,203,204,40],"20873920","project\u002Fneutral\u002Fnone","rixed",[206,40,41,203,207,40],"20874185","Stratoscope",[209,40,41,203,210,40],"20876335","Mvhsz",[212,40,37,213,214,40],"20885950","project\u002Fcritical\u002Fdocs","Izkata",[216,40,41,203,217,40],"20874208","lkesteloot",[219,40,41,220,221,40],"20874250","project\u002Fneutral\u002Fidea","abra0",[223,40,41,203,224,40],"20876034","aldanor",[226,40,41,220,227,40],"20877634","k_s",[124,40,41,220,125,40],[146,40,41,220,147,40],[231,40,41,220,147,40],"20896724",[233,40,41,220,125,40],"20924292",[158,37,41,220,159,40],[187,37,40,236,11,37],"maker\u002Fneutral\u002Fidea",[94,238,41,239,95,40],2,"maker\u002Fmixed\u002Fperformance",[190,238,40,241,11,37],"maker\u002Fpositive\u002Fnone",[243,238,37,244,245,40],"20875128","project\u002Fcritical\u002Fperformance","jnordwick",[247,41,41,220,248,40],"20874253","dwohnitmok",[250,31,37,251,252,40],"20872890","project\u002Fcritical\u002Fexecution","panda88888",[254,31,40,255,11,37],"20872907","maker\u002Fneutral\u002Fexecution",[257,31,37,251,252,40],"20873002",[259,31,41,260,261,40],"20873019","project\u002Fneutral\u002Fexecution","kadoban",[263,31,40,264,252,40],"20873040","commenter\u002Fneutral\u002Fnone",[266,31,40,267,261,40],"20873076","other\u002Fneutral\u002Fnone",[269,31,40,260,11,37],"20873045",[271,31,37,251,272,40],"20873034","flafla2",[274,31,40,275,261,40],"20873062","commenter\u002Fneutral\u002Fexecution",[277,31,40,278,11,37],"20873708","maker\u002Fneutral\u002Fdocs",[78,31,18,280,79,40],"project\u002Fpositive\u002Fidea",[106,31,40,255,11,37],[283,31,41,260,261,40],"20872977",[285,18,40,286,11,37],"20874375","maker\u002Fpositive\u002Fidea",[288,18,18,241,67,40],"20877777",[290,18,18,291,248,40],"20884249","maker\u002Fpositive\u002Fexecution",[293,18,40,200,11,37],"20915663",[150,38,41,198,151,40],[296,38,40,255,11,37],"20873126",[298,38,40,275,151,40],"20873469",[116,38,41,300,117,40],"maker\u002Fneutral\u002Fperformance",[302,303,41,304,79,40],"20872929",7,"project\u002Fneutral\u002Fperformance",[306,303,37,244,261,40],"20873011",[308,303,40,255,11,37],"20873063",[310,303,40,267,63,40],"20873121",[312,303,41,260,88,40],"20874210",[314,303,40,264,315,40],"20874297","saagarjha",[317,303,40,267,318,40],"20874784","rurban",[320,303,40,264,315,40],"20883990",[322,303,40,264,315,40],"20874252",[324,43,41,198,325,40],"20874705","meuk",[132,43,40,255,11,37],[328,329,41,220,330,40],"20874963",9,"carl8",[332,329,40,333,334,40],"20877368","other\u002Fneutral\u002Fidea","proverbialbunny",[336,337,37,338,245,40],"20875028",10,"project\u002Fcritical\u002Fidea",[87,340,37,338,88,40],11,[342,340,40,343,315,40],"20874239","other\u002Fneutral\u002Fperformance",[345,340,40,236,11,37],"20874279",[347,340,40,264,88,40],"20874316",[349,340,18,350,351,40],"20874691","project\u002Fpositive\u002Fperformance","anarazel",[353,340,41,304,354,40],"20875595","snovv_crash",[356,340,37,244,334,40],"20877592",[62,358,41,220,63,40],12,[360,358,37,244,261,40],"20873112",[362,358,37,244,117,40],"20876454",[364,358,40,264,334,40],"20877648",[366,358,40,264,261,40],"20879107",[368,369,37,213,370,40],"20874321",13,"bt848",[372,369,40,278,11,37],"20874416",[66,374,40,267,67,40],14,[166,376,37,338,167,40],15,[120,378,41,304,121,40],16,[380,381,37,244,382,40],"20874449",17,"superphil0",[109,381,40,255,11,37],[385,181,41,304,386,40],"20873627","Thorrez",[388,181,40,260,11,37],"20874296",[390,391,41,220,392,40],"20873598",19,"ummonk",[394,391,41,304,395,40],"20873742","baiwan123",[397,391,37,244,398,40],"20874128","ant6n",[400,33,41,220,401,40],"20874975","enriquto",[403,33,40,300,11,37],"20879228",[405,406,41,304,407,40],"20874825",21,"JulianWasTaken",[409,410,40,267,411,40],"20874638",22,"jason0597",[413,410,40,267,414,40],"20874677","tempay",[416,410,40,267,417,40],"20874690","rosstex",[419,410,40,267,420,40],"20874697","kbsletten",[422,410,40,267,423,40],"20874848","kmbriedis",[425,410,40,267,426,40],"20875564","jwandborg",[428,410,40,267,411,40],"20894422",[430,431,37,338,432,40],"20873961",23,"nayuki",[178,434,37,338,147,40],24,[436,437,41,438,439,40],"20874745",25,"project\u002Fneutral\u002Fdocs","szemet",[441,442,41,220,443,40],"20877453",26,"Glyptodon",[445,446,40,267,447,40],"20875146",27,"known",[139,449,37,338,140,40],28,[451,449,41,220,452,40],"20873949","FridgeSeal",[454,449,40,264,151,40],"20874069",[456,449,37,213,140,40],"20874141",[458,449,40,264,459,40],"20876143","adwn",[461,449,40,264,151,40],"20876360",[463,449,40,264,88,40],"20874255",[465,449,40,300,11,37],"20874339",[467,449,37,244,468,40],"20880716","quickthrower2",[],[471,476,481,486,491,495],{"id":472,"name":473,"points":474,"category":475},"20860852","Face Generator",256,"creative",{"id":477,"name":478,"points":479,"category":480},"20865426","Ackee",214,"web_saas",{"id":482,"name":483,"points":484,"category":485},"20865012","Fullstack ML",198,"ai",{"id":487,"name":488,"points":489,"category":490},"20857887","Hacker News Clone",179,"learning_science",{"id":492,"name":493,"points":494,"category":480},"20830726","HackerRank Projects",134,{"id":496,"name":497,"points":498,"category":499},"20860053","workoutbff.com",131,"consumer_social",false,"v2",{"id":503,"name":5,"line":6,"ai":500,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":504,"top":18,"kw":505,"maker":11,"domain":10,"tier":19,"attempts":40,"strip":506,"url":9,"mix":507,"praise":74,"objection":83,"sub":21},20872696,-0.25,[24,25,26,27],"3313333113105533130331051111131300111311",[31,32,31,33],1794036580514]