![]() |
CITS2002 Systems Programming |
← prev | next → | ![]() |
![]() |
|||
Storing and searching ordered data - a binary treeEach of the previous self-referential data-structures stored their values in their order of arrival, and accessed or removed them in the same order or the reverse. The actual time of insertion is immaterial, with the relative times 'embedded' in the order of the elements.More common is to store data in a structure that embeds the relative magnitude or priority of the data. Doing so requires insertions to keep the data-structure ordered, but this makes searching much quicker as well. Let's consider the type definition and insertion of data into a binary tree in C11:
CITS2002 Systems Programming, Lecture 19, p18, 3rd October 2023.
|