Topic: The compiled search tree.
There is a task of fast search of the named objects in a tree structure reminding file system with directories and files, files it is objects of type "1" and directories it is objects of type "2" to give an example easier - 1:1 1:2 1:3 1:4 2:5 2:6 2:1 2:3 3:10 3:11 3:12 3:14 Within the limits of a directory objects are unique. In analogy to file system - there can not be two files with the same name. Directories also are unique. An example close to the real: \aaaa\eeee\yyyyy\ooooo (01): \bbbb\cccc\dddd\eeeee \aaaa\eeee\yyyyy\ooooo (01): \bbbb\cccc\dddd\qqqqqq \aaaa\eeee\yyyyy\ooooo (01): \bbbb\cccc\dddd\hhhhh \aaaa\eeee\yyyyy\vvvvv (02): \bbbb\cccc\dddd\eeeee \aaaa\eeee\yyyyy\vvvvv (02): \bbbb\cccc\dddd\qqqqqq \aaaa\eeee\yyyyy\vvvvv (02): \bbbb\cccc\dddd\jjjjjj \aaaa\eeee\yyyyy\ddddd (03): \bbbb\cccc\dddd\eeeee \aaaa\eeee\yyyyy\ddddd (03): \bbbb\cccc\dddd\qqqqqq \aaaa\eeee\yyyyy\ddddd (03): \bbbb\cccc\dddd\wwwww \aaaa\eeee\yyyyy\lllll (04): \bbbb\cccc\dddd\eeeee \aaaa\eeee\yyyyy\lllll (04): \bbbb\cccc\dddd\qqqqqq \aaaa\eeee\yyyyy\lllll (04): \bbbb\cccc\dddd\ffffff In brackets before a colon it not a part of a line DIR, and certain ID for this purpose DIR-a. It is required: 1) quickly to search on requests of type: 1) to find ID for DIR =\aaaa\eeee\yyyyy\ooooo, 2) to find object \aaaa\eeee\yyyyy\vvvvv if ID=102) to Store it in somebody (binary file) which at loading can be transformed already into a certain tree or everything. Yes, forgot important to add - ID for DIR, it is assigned in , that is it is not known in advance - at "a compilation" stage. Well we tell, in runtime there is a certain event a name to which and is DIR, it should be found in our basis, and at this event is certain ID which to it should be appropriated. Such events can arise simultaneously a little. Then there is a second type of event a name to which OBJECT and for it is known ID and here it is necessary to find this object in our basis. Then there is a third type of event a name to which DIR and it ID is known, and it is necessary to find it in basis and to delete this ID from DIR. ps: In advance thanks!