cltnarrays.pas
来自「《Delphi技术手册源码》原书佩戴的光盘」· PAS 代码 · 共 15 行
PAS
15 行
unit CltnArrays;
(*
Implement collections using arrays.
IList and IStack are obvious for array implementations, but ISet and IMap
can also work with arrays. TSortedList implements IList, but storing all
items in sorted order. TSortedArraySet and TSortedArrayMap use TSortedList
to implement ISet and IMap. It turns out a sorted array is only slightly
slower than TRbTree for many operation, and for collections that don't
change size much, an array uses less memory than hash tables and trees.
TArraySet and TArrayMap complete the suite, but are usuable only for
the tiniest of sets. For sets that contain just a few elements, though,
the lower overhead may indeed prove beneficial.
Copyright
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?