What is an elementary data type?
The basic types of data that serve as the building blocks for data manipulation.
What is a composite data type?
Data types which are collections of elementary data types.
What is an abstract data type?
An abstract data type (ADT) is a logical description of how we view the data and possible operations. We are concerned only with what the data is representing and not how it is constructed.
What is a queue?
A queue is a abstract data structure which operates on a first-in, first-out principle, meaning the element that has been in the queue the longest is the next to be removed.
- Some queues use pointers to store where in the data the queue begins and ends,
- Some queues are circular and can reuse spaces dequeued from the front,
- Some queue have a priority system and items with a higher priority will be placed before those with lower ones.
What are the 4 distinct operations of a queue?
What is the difference between static and dynamic data structures?
Static data structures are fixed in size, they cannot grow, shrink, or be freed during execution.
Dynamic data structures can grow and shrink. They allocate and deallocate memory from the heap (an area of memory especially used for this purpose), excessive allocation of memory, without deallocation, may cause overflow.
What is a list?
A list is a collection of items that are finite in number and in a particular order.
- A dynamic data structure such as list is useful for implementing other ADTs such as queues, stacks and trees.
What are the distinct operations of a list?
What is a stack?
A stack is a abstract data structure which operates on a last-in, first-out principle, meaning the element that has been in the queue the shortest is the next to be removed.
What are the 4 distinct operations of a stack?
What is the call stack?
The call stack is a system level data structure which provides the mechanism for passing parameters and return addresses to subroutines.
How are calls to subroutines executed?
How are subroutines executed?
What is a stack frame?
A stack frame contains all the parameters, the return address and the local variables for a single call to a subroutine which has not yet completed.
What is a hash table?
A hash table is an abstract data type used to store the unique addresses (calculated from the data itself through a specific algorithm) of data items rom a large data set in order to give us the ability to find any record very quickly.
What is a collision in the context of hashing?
A collision happens when an algorithm generates the same address for different primary keys.
How do hash tables deal with collisons?
One method is to put the item in the next free slot in the table. Another is to skip to a slot which is a specific amount (the skip factor) of slots away and attempting to store it there, repeating this if it can’t.
What is the load factor of a hash table?
The load factor is the ratio of the number of stored elements (n) to the number of available buckets (b). It is calculated as:
load_factor = n / b
What is the ideal hash table size?
The table size needs to be large enough so that the load factor is not more than about 50%-70% of table size.
Additionally, it is beneficial if the table is a prime number so that all slots can be filled no matter the skip factor.
How does the mid-square hashing algorithm work?
How does the folding hashing algorithm work?
How can you hash alphanumeric data?
Alphanumeric data may be converted to numeric data by using the ASCII code for each character, then applying a hashing algorithm to the resulting series of digits.
How do hash tables deal with deletions?
Items to be deleted must be replaced with a dummy item or marker, for example the word “Deleted”. When searching for an item which hashes to that spot, if it is not found, the search will continue until it is found or a free space located.If a new item is to be added, it will replace the deleted item.
What is a dictionary?