I'm just curious, as I have seen using Hashmaps in Java recently and am wondering if the Delphi Sorted String list is generally similar.
Does the TStringList object create a hash to use as an index for each item? And how does a search string get checked for a list of strings through the Find function?
I use Sorted TStringLists very often, and I just would like to understand that a little more is happening.
Suppose I don’t know how a hash map works, because I don’t :)
thank
I interpret this question, as a rule, as a request for an overview of lists and dictionaries.
L D.
L
D
. , . , - .
, . V I, , L[I]=V. . , , . - .
L[I]=V
<Key,Value>. , : D[Key]. , , - L[I], I.
<Key,Value>
D[Key]
L[I]
Delphi . . .
Delphi TDictionary, , . , , , .
TDictionary
, : , , . .
TStringList .
"" , (Sorted property = false), QuickSort.
, Sorted true.
Find ( IndexOf, find) (Sorted property = false, , Sorted ), , .
Find (Sorted property = true), (. http://en.wikipedia.org/wiki/Binary_search ).
, , , .
- , . , , , Sorted back to true, .
, .
EDIT: -, TDictionary Generics.Collections
, Delphi. Ctrl- "" .
-Unicode Delphi Unicode . . , Delphi, , , , Unicode . / , - .
, , ( Objects). - , . , ( "2" "1", "19" )
THashedStringList, ( Delphi).
BTW, Unicode TStringList . TStringList.CompareStrings, Ansi (, , ), Ansi. TStringList, , 4 , TStringList / .
Delphi ( Delphi ) , Delphi. THashedStringList , . , , , , .
, , . , , , .
, , .
Source: https://habr.com/ru/post/1794603/More articles:Getting a contact phone number - androidIS VB.NET more portable than C #? - c #Primary prototype / skeleton in Django - djangoHow to get ViewData inside a form to display correctly? - asp.net-mvcHow to use breakpoints correctly when using an object initializer? - c #How to use only the default git port with gitorious.org - gitHow to jump to modified strings in Emacs using vc-diff? - svnSilverlight text box conditional style binding - windows-phone-7Lua Nested Unpack Bug? - luaGoogle App Engine Task Queue - performanceAll Articles