Learn something new every day
More Info... by email
Finding an item in a computer data list can be difficult and time consuming, which is why the search data structure was created. A search data structure is any data structure that can be automatically searched, be it a large database or a small list. There are two main types of search structures, static and dynamic; static cannot change, while dynamic allows modification. Searching can be a costly operation, so most data structures are optimized to help the search function find the data. Locating items quickly is an obvious advantage to this structure but, since it is so costly, the search function is best used with large structures.
Unlike most other data structures, a search data structure can be any type of data structure. The dominant characteristic of this structure is that users can search through the structure via a query; the structure also must have at least two items in a list, though most structures have tens, hundreds or thousands of items. This means a database, list, string or binary tree can qualify as a search structure.
A search data structure can be broken down into one of two categories: static and dynamic. The static version is unchangeable, and users are only able to search the list. This structure is much easier to maintain, because users do not have to worry about changing the bookmarking system and searching is typically easier. Dynamic structures allow users to modify items, either by changing or by deleting them, but they are harder to run. Items can change so frequently that there must be a bookmarking system to keep track of every item’s position.
Searching through a data structure can be costly, meaning it can take a lot of time and effort for the computer. For example, if a data structure is linearly searched and the item is at the bottom, then the query will have to look through every item until it finds the correct one. To help the computer, most search data structures are optimized by using a bookmarking system and by breaking the structure up into sections so the search query can look through the right section instead of the entire structure.
The obvious benefit to using a search data structure is that users can search records until they find the specific information they need. At the same time, because the query is so costly, this is not as beneficial on smaller data structures. If the data structure is small and can be easily searched by a person, then it may actually take longer for the computer to find a record than if a user did the search manually.