data structures Flashcards
(15 cards)
what is an array?
an ordered finite set of elements of a single type
how do you search through a 2D array?
go down the rows then across the columns to find the given position
what is a record?
is a row in a file that is made up of fields, they are used in databases
what is a list?
-data structure consisting of a number of ordered items where they can occur more than once.
-They are stored non-contiguously (do not have to be next to each other in memory unlike arrays)
-can contain multiple data types
what are tuples?
ordered set of values of any type, it is immutable (cannot be changed)
once elements are added they cannot be removed
what is a linked list?
dynamic data structure used to hold an ordered sequence
each item is called a node and contains a data field
what is a stack?
a last in first out data structure, items can only be removed from the top of the stack
used to reverse an action
what is a queue?
a first in first out data structure, items are added to the end and removed from the front
linear queues are datas structures consisting of an array
what is a tree?
-connected form of a graph
-have a root node which connect other nodes by branches
traversing a binary tree methods?
pre order, in order, post order
how to do pre order?
outline the tree
begin from the far left line
order them when at the number’s left
how to do in order?
outline the tree
begin from the left
order them when below the number
how to do post order?
outline the tree
begin from the left
order them when on the right of the number
what is a hash table?
an array which is coupled with a hash function
takes a data (key) and releases an output (hash)