When implementing elementary data structure, such as stack, queues, linked listet al. Should I create a pool of resources (nodes) by dynamically allocating memory in a bundle or should I allocate memory separately each time I need a node?
stack
queues
linked list
It totally depends on your goals. By default (i.e. unless you really need to do otherwise), just do a normal distribution for each next node.
Memory pools compared to just distribution nodes:
Make selection faster. Depending on the underlying distribution mechanism, sometimes much faster.
, .
: , . , (, 1000 ), .
- .
++ allocator.
allocator
. , :
, , , O (1). " " , , , , , O (n). , .
node, , , , , . , , .
, , , , , .
Source: https://habr.com/ru/post/1755092/More articles:Porting Py3k libraries - pythonBest approach: HTTP POST (multi-part) from Android to GAE - javaGet rows where day is equal to some value - sqlДобавить поведение в существующий атрибут onclick в javascript - javascriptStrange logic with bool - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1755093/mysql-indexes-to-set-for-a-query&usg=ALkJrhjU7E-L0gDvFkpJ37CmUDhXwdkgAwHow to check the ideal optimization algorithm? - algorithmNested top 1 picks in Linq - c #How to create iPhoto as an interface - cocoaIs an SMTP server required to send mail through a web server using the JavaMail API? - javaAll Articles