📜 ⬆️ ⬇️

Comparison of structure characteristics for search operations

When considering the implementations of the search found an interesting table with the characteristics of the structures used to implement the symbol tables. And considered the worst and average cases.

worst caseaverage case
insertSearchthe choiceinserthit by searchmiss while searching
array indexed by keysoneoneMoneoneone
ordered arrayNNoneN / 2N / 2N / 2
ordered link listNNNN / 2N / 2N / 2
unordered arrayoneNNlnnoneN / 2N
unordered linked listoneNNlnnoneN / 2N
binary searchNlnNoneN / 2lnNlnN
binary search treeNNNlnNlnNlnN
red-black woodlnNlnNlnNlnNlnNlnN
random treeNNNlnNlnNlnN
hashingoneNNlnnoneoneone

')

Source: https://habr.com/ru/post/99744/


All Articles