sql - When to choose a Dictionary ADT -
in college learned 3 main abstract data types containers (stacks, queues, , tables), dictionaries, , priority queues. there unlimited number of ways group adts @ high level this, start.
i don't understand when choose dictionary adt solve computational problem though. stacks , queues seem come naturally, not dictionaries.
the 1 example can think of dictionary in sense use in real world. dictionary keeps , ordered set of words fast lookup, , when word is: correct spelling, how pronounce word, part of speech is, definition of word, etc.
as i'm starting understand better, more seems "dictionary" way think of querying database. when write sql select statement, you're looking when primary key equals value (not of course, can select on field exists in table).
is correct way think of dictionary adt? or intended use more limited this...
your sql example pretty accurate. you're searching primary key (the key of dictionary entry) fields (the values) associated it.
i found dictionaries useful in game programming courses. load resources , cache them dictionary later use. way, didn't have know index number specific resource, give key relate resource.
Comments
Post a Comment