What is the best data structure (container) for quickly inserting / deleting items by index?
You can get O (log n) performance using a binary tree with a node structure like this:
struct Node<T> T value Node left int left_count Node right int right_count end
left_count left . , , . count. .
left_count
left
, , ; !
, - . - B-, ( , node ).
Try a hash table dynamically resized at fixed intervals.
Assuming a pretty good uniform distribution, you should have basically constant access time [O (1)].
http://www.cs.cornell.edu/courses/cs312/2006fa/lectures/lec14.html
This link seems to give a good explanation.
Source: https://habr.com/ru/post/1727366/More articles:Inheriting from a user control to use another child control - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1727362/is-it-possible-to-restrict-certain-asmx-web-service-methods-to-get-or-post-only&usg=ALkJrhg2NujkzhSp6732cCrID0xZUzGqGQhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1727363/ioc-to-register-repositories-in-service-layer-and-services-in-the-preentation-layer&usg=ALkJrhjc4lg-savkF1xvtJbI0Wte0xkHcQКакая структура данных для O (1) случайной вставки/удаления и O (1) случайного доступа? - performanceStrange attribute value specified by FindFirst (), Attr = 2080 - delphiMultithreaded python application freezes when threads start - pythonHow can I safely port my Wordpress blog to localhost? - phpTool for detecting problems with pointer aliases in C / C ++ - c ++UITableView spaces when using dynamic row height - objective-cImplementing a vector class in Delphi? - mathAll Articles