Hashing Flashcards
Define ‘lossy compression’
Compression where non-essential data is removed to free up space, for example:
Different shades of the same colour in an image
Frequencies of sound outside the human hearing range
Define ‘lossless compression’
Compression where the computer analyses patterns in the data, and summarises it in a shorter format - without removing any information.
How does lossy compression work in images?
Different shades of certain colours are removed
Picture is reconstructed with less coloured pixels
How does lossy compression occur in sounds?
Sounds with frequencies outside the range of human hearing are removed from the file
Quieter notes playing at the same time as louder notes are also removed from the file
What is the difference between lossy and lossless types?
Lossy: Is most effective at reducing file size
Lossless: Maintains the information of the original data
What is lossy compression typically used for?
Audio files and pictures
State the effect of using lossy compression on pictures and audio
Pictures files: Would lose their original resolution, as there are less individual colours to make up the picture
Sound files: Would lose their sharpness
State one method of lossless compression and where it is used
Run Length Encoding: Used in pictures and sound files.
Dictionary Compression: Used in word files
Explain how Dictionary Compression works:
Repeating words / characters are added to a dictionary, and assigned a [shorter] binary value
Explain what state a data set must be in in order to use binary search
Data must be sorted in either ascending or descending order
What is a hashing table?
A data structure which will find any record in a dataset instantly
What is hashing?
Organising large data sets so each record has its own unique address
Records are organised via hashing algorithms/hash functions
Define ‘collision’
When an algorithm generates the same address for primary keys
State the simplest method for dealing with collisions
Putting the item in the next free slot in the table
State one alternative method for dealing with collisions
Incrementing the ‘skip’ value by adding another number to find a free space