4 + 9. Data Representation and Algorithms Flashcards
What is a bit?
A binary digit (a bit) is the fundamental unit of data storage, and will have a value of 0 or 1.
What is a byte?
A group of 8 bits.
What is a word?
Word refers to the amount of data that can be handled at one time by the processor.
Why is hexadecimal used as a shorthand for binary?
Long sequences of binary digits are hard to read and understand for humans.
How is text represented?
In order to represent text, each individual letter or character must be represented a unique binary pattern. In order to consistently represent characters from many different languages, these patterns must universally understood (through ASCII and Unicode).
How are numbers represented?
Numbers are represented using number base systems, which determine which digits are used to represent a number.
What is a character set?
Character maps are used to represent each character. Each character is mapped to a binary number. Allows for standardised communication between computer systems
ASCII - Can only represent 128 characters (not sufficient to represent all languages/scripts)
What is bubble sort?
The bubble sort algorithm works by repeatedly going through a list of items, comparing consecutive pairs of items and swapping the items if they are in the wrong order.
Each time the algorithm goes through the list a pass is complete.
The passes through the list are repeated until the items are sorted.
Bubble sort can be used on an ascending or descending list.
What is an Insertion Sort?
The insertion sort algorithm works by building up a sorted sub list in the first part of the original list, while the remaining part of the list remains unsorted.
The algorithm goes through the unsorted sub list, item by item. As each item is examined, it is moved into the correct position (in ascending or descending order) in the sorted sub list. This progresses until the final item is correctly inserted and the list is sorted.
What is binary search?
The algorithm calculates a midpoint and depending on if the list is ascending or descending will ignore a certain half of the list and focus on the half that contains the desired the item. It repeats this process until the item is found.
What is linear search?
The algorithm for this process is called linear search, because it involves starting from the beginning of the list and checking one item at a time to see if it’s the right one.
Describe appropriate circumstances for the use of binary and linear search?
- Requires input data to be sorted, linear doesn’t.
- Binary search requires an ordering comparison, linear search only requires an equality comparison
- Linear search would be slower than binary search on a larger list/
Why do we need to data compress?
Data compression is used so large files can be transferred over a cable or wireless communications link easier and faster. Compression algorithms are used to store large files in limited storage, it saves space and money.
What is lossy compression?
Lossy compression refers to loss of data (data is removed). When the file is decompressed, the data that was removed is re-created from the data that remains in the file. The re-created data will never be an exact copy of the original. Instead, it will be an approximation of the original data.
What is lossless compression?
Lossless compression refers to no data is lost in the compression process. When the file is decompressed, the contents are identical to the original file.