What is an array?
An array is an ordered, finite set of elements of a single type, where the elements are stored contiguously in memory. Each item has a common identifier and can be accessed by their index position in the array.
What is a record?
A row in a file made up of fields.
What are 2 key features of records?
It is mutable and can store multiple data types.
What is 2 key feature of list?
It is mutable, store multiple data type.
3 difference of list and array?
1.In list data is not stored next to each other in memory.
2.In list you can add data and change data while can only change data in array.
3.In list can have multiple data type but array only have 1,
What is 3 feature of tuple?
1.Immutable
2.Static data type
3.Dont need to have same data type.
What is a linked list?
1.A dynamic data structure
2.Each node consist of data and a pointer
3.Pointer gives location of next node.
What is clustering?
Several position being filled around common collision values.
What are all the solution of resolving collisions(3 solutions)
1.To repeatedly check the next available space in the hash table until an empty space is found(Open addressing)
2. Finding an alternative position of item in the hash table known as rehashing.
3.Chaining the items are in the same position but in different element of the 2D array.
4.Use a overflow table or linked list which can be searched sequently
What is the benefit of Hash table over Linked list when we have a lot of data and incoming data?
1.Linked list will require each node to be checked.
2.A linked list will take longer to search as more data is added.
3.Hash tables enable direct access to the location of record.
4.It takes no longer to search as more
records are added
What is linear probing in hash table?
Linear probing is a technique where the hashing function provides a start position, and a linear search is then applied from that point until the item is found.
What is a graph?
A data structure containing nodes/vertices and pointer/edge.
What are the 2 types of graph and how are they different?
Can be directed and undirected. Undirected means there is no specified direction but directed means point in one direction.
What else can each edge/pointer be given?
Can be weighted with each edge given a value representing a relationship between nodes/vertices.
How else can we store graphs?
Using an array. Known as an adjacency matrix.
In an adjacency matrix how can we represent a link between 2 nodes if has no weight?
With 1 and 0s
What is a stack known as?
Last in first out
What are some operation that can be used on a stack.
Pop-Which pops the data at the top of the stack
Peek-Peek at the top item
Push-Push an item on a stack
What are the 2 errors that can happen in a stack.
Stack overflow-When an item is pushed on a full stack
Stack underflow-When an item is popped on a empty stack
What are application of stack?
Undo operation
What do stack use and how they are normally implemented?
Implemented using an array and stack has pointers. A stack has a stack pointer that always point to the node at the top.
What type of data structure is a queue.
First in first out
How would we add data and remove data in a queue.
Using enqueue and dequeue.
What else can we do to a queue?
Use a peek operation with show the first item withought deleting it.