Data structures Flashcards
Array?
A data structure that hold a number of data items of the same data type
Record?
Data structure that consists of a fixed number of variables called fields
List?
Abstract data type that describes a linear collection of data items
Tuple?
Collection of elements that is immutable
Stack
First in last out, first item to enter is the last to leave
Examples of stacks
Stack of plates
Web browser history
Call logs
2 computer based uses for stacks
Manage memory location
Store temporary variables created by a function
Operations that can be performed on stacks
Push
Pop
Peak
Is empty
Is full
Describe role of the top pointer in stack
Let’s the user know if the stack is full
Queue
First in first out data structure
3 Examples of a queue real life
Actual queue at supermarket
On the music app
Printer receiving jobs
Operations that can be performed on queue
Enqueue
Dequeue
Is empty
is full
Describe how a circular Queue works
There is a fix number, and it is still static the once it has been dequeued It can be replaced and wraps around in a circle.
And advantage of a circular Queue over linear
It can keep going around in a circle
Linked list
An abstract data type similar to queue or stack, a dynamic data structure.