![]() |
Created by Elliot Smith
almost 7 years ago
|
|
Question | Answer |
What is the difference between a procedure and a function? | A function returns a value and a procedure just executes a series of commands |
What is the difference between a variable and constant? | A variable can be changed throughout the code whereas a constant remains the same and can’t be changed |
State the advantages of using named constants? | You can’t accidentally change its value and it makes programming code more readable than using values |
What is an algorithm? | A sequence of steps that can be followed to complete a task and that always terminates. |
What is representational abstraction? | Representational abstraction is the process of removing unnecessary details |
What is Procedural abstraction? | Procedural abstraction is the process of running low level code which isn’t understood but is displayed in a coherent manner. |
What is data abstraction? | Data abstraction is the programming process of creating a data type that hides the details of the data in order to make the data type easier to work with. |
What is information hiding? | It is the process of hiding the details of an object or function |
What is decomposition/composition? | Decomposition is the process of breaking a big problem into a smaller one and composition is the process of combining procedures or objects into something like a list |
What is problem abstraction? | It is the process of reducing a problem to the extent where it is represented in a way that can be solved |
What is automation and how can it be achieved? | It is putting models (abstraction of real world objects) into action to solve problems which can be done by making algorithms and converting it into code that can be executed. |
What are natural numbers and what letter represents them? | They are positive integers greater than 0 represented by N |
What is an ordinal number? | An Ordinal Number is a number that tells the position of something in a list. |
What is the difference between signed and unsigned binary? | Signed binary uses the first bit to indicate whether it is positive or negative and unsigned doesn’t |
What are the results of these binary sums 0 + 0 , 0 + 1, 1 + 1 and 1 + 1 + 1? | 0, 1 , 0 (carry a one over), 1(carry a one over) |
What are the result of these binary multiplications 0*0, 0*1, 1*1? | 0, 0, 1 |
How would you display the fixed-point binary number 4.5 in binary if the d.p is between the 4th and 5th bit? | 0100.1000 |
What is twos complement and how do you convert into it? | It is a method of displaying negative numbers in binary by flipping all the bits of the original number and adding 1. |
Why was Unicode introduced? | The original ascii coding system doesn’t have enough values to display every character but Unicode has more bits meaning it can represent more characters. |
What is a parity bit? | Is an additional bit that is used to check whether the other send bits are correct. In odd parity the number of ones odd and in even parity the number of ones is even. |
What is majority voting? | It is a system that requires every bit to be transmitted three times and the mode value is taken for each bit. |
what is a check digit? | A check digit is an algorithm that is applied to data before its transmission and stored as a digit on the end which after being received is recomputed and if they’re the same then the transmission has been successful. |
What is an analogue/digital wave? | An analogue signal is a continuous wave that keeps on changing over a time period whereas a digital one is discrete. |
How is a bitmap represented? | A bitmap is an image that is made up of many pixels which have binary values which represent specific colours |
What is the resolution of an image? | It is the width by the height of an image |
What is the bit/colour depth of an image? | The bit depth is equal to the number of bits stored for each pixel |
How is the file size of an image calculated and why might the real value vary? | It is the product of the resolution and the bit depth. Metadata takes up space as well. |
What is metadata? | It is data about data. E.g. (Colour depth, author, file size) |
What is the sampling resolution of a sound file? | It is the number of bits used to represent the amplitude of the sound at a given time |
What is the sampling rate of a sound file? | It is the frequency at which you record the amplitude of a sound |
What does Nyquist’s theorem state? | It states that in order to produce an accurate recording of sound, the sampling rate must be at least double the maximum frequency. |
How do you calculate the size of a sound file? | sampling rate x No. of bits per sample x length of each sample |
What is the purpose of midi? | It allows a wide variety of instruments and digital related devices to connect with each other and communicate. |
What does a controller do in midi? | It carries event messages which specify pitch, duration of a note and other sound calibrations. |
What are the advantages/disadvantages of midi? | File sizes are smaller, no interference or background noise during its recording however it is dependent on the quality of the sound card and it sounds less realistic. |
Why is compression used? | It is used so that data takes up less disk space resulting in it also requiring less bandwidth if it is sent across a network for a faster transmission. |
What is lossy and lossless compression? and state their advantages/disadvantages | Lossy compression works by removing all non – essential information which significantly reduces file size, but it also reduces the images quality. Lossless compression looks for patterns in the data and stores them rather than the original file which results in no loss of quality however it doesn’t shrink the size as much. |
Explain what RLE is and how it works | Run length encoding (RLE) is a method of compression that instead of recording every pixel it states a single pixel and states how many times it repeats |
State what dictionary-based compression is | A text files contents is scanned and every word inside is stored with its corresponding dictionary value rather than storing each character individually. |
What is encryption? | It is the process of converting information into cipher text so that only authorized people can decode what it actually means. |
Why is the Caesar cipher easy to break? | There are at most on 25 possible shifts before you have cracked the cipher text. |
What are the conditions so that a one-time pad can’t be cracked? | The one-time pad must be longer in characters than the plain text, it must be truly random, only used once and destroyed after its use. |
Define hardware | Hardware is the physical parts or components of a computer such as the monitor. |
Define software | Software is the parts of a computer that consists of data or instructions |
What are the two types of software? | System and application |
What is system software? | It is the software needed to run the computers hardware and application programs such as the operating system. |
What is the OS? | An operating system is a set of programs that manages the operations of the computer for the user. It acts as a bridge between the user and the computers hardware. |
What functions does an OS perform? | It provides a UI to hide the complexities of the operations from the user. It also controls memory management, processor scheduling, backing store management and peripheral management. |
Explain what memory management is | It is process of controlling and coordinating computer memory, assigning portions of it to various running programs to optimize the overall system performance. If there isn’t enough memory the hard disk is temporarily used as ‘virtual memory’. |
Explain what processor scheduling is. | Processor scheduling is the allocation of a computer's processor power to specific tasks for a given time. The OS also uses a priority queue for every task. Each task is performed so quickly that it gives the appearance that they are done simultaneously. |
List the objectives of a scheduler. | To maximise throughput (flow of data), be fair to all users on a multi-user system, provide an acceptable response time and ensure that hardware resources are kept as busy as possible. |
Explain what backing store management is? | This is the task of the OS to manage files and also allow the user to perform tasks such as moving, deleting and renaming files. |
Explain what peripheral management is? | Peripheral management controls peripheral devices by sending them commands in their own computer language and are allocated to processes without causing conflicts. |
What is a utility program? | Utility software is system software designed to help analyse, configure, optimize or maintain a computer. E.g. (A virus checker or disk defragmenter) |
What are library programs? | Library programs are pre-compiled programs which can be run when needed. |
What is a translator program? | It is a computer program that translates from one programming language into another and they come in three forms, a compiler, interpreter and assembler. |
Explain what the four types of application software there is and give an example. | General-purpose software such as spreadsheets can perform a wide range of tasks. There is also special-purpose software which performs a single task or only a few tasks such as fingerprint scanners. Bespoke software is software specifically tailored to the individuals needs and off-the-shelf software which can be bought ready to use instantly which has the benefit of it being well documented. |
What is a compiler? | It is a piece of software that converts high-level language into machine code all a the same time. Different hardware platforms will require different compilers. |
What is an assembler? | It is a piece of software for converting instructions written in assembly code into machine code. |
What is an interpreter? | It is a piece of software that analyses code and executes the code line by line. |
What are low – level programming languages? | It is a programming language that provides little or no abstraction from a computer's instruction set such as assembly or machine code. |
What are high – level programming languages? | It is a programming language with strong abstraction from a computer's instruction set such as C# or python |
What is an imperative programming language? | Imperative programming is a paradigm of computer programming in which the program describes a sequence of steps that change the state of the computer. |
What are the differences between a high and low-level programming language? | A low-level language is platform dependent (different code is needed for different hardware) whereas high-level languages aren’t. Low-level languages are faster as they don’t need to convert their code for the processor to understand. A high-level programming language is easier to code as it is near English whereas machine code is pure binary and assembly code is in mnemonics. High-level languages are easier to debug as they are checked for syntax errors. |
What is bytecode? | Instead of interpreting the code modern virtual machines convert the code into bytecode. The advantage of bytecode is that it is platform independent (can be run on computers with different instruction sets) and can be converted into other programming languages bytecode if necessary. |
What are the advantages of a compiler? | The object code of a compiler can be saved on the disk and run whenever. The object code executes faster than interpreted code. The object code produced by the compiler can be distributed and executed without the compiler present. The object code produced is more secure and cannot be read directly. |
What are the advantages of an interpreter? | The code doesn’t need to be recompiled every time an error is spotted, and it is easier to debug programs. |
What is an XOR logic gate? | It is an or logic gate that can have one condition met for the gate to return 1. |
What shape is a AND, OR and NOT gate? | It is a D shape (AND), an arrow head shape (OR) and a small circle attached to the front of a triangle (NOT). The small circle can also be attached to an OR/AND to form a NOR and NAND gate. |
What are the Boolean symbols? | A letter is an input, an over score/bar means NOT, a plus means OR, a dot means AND and a crossed circle means XOR. |
What is De Morgan’s law? | Cut the line and change the sign. |
What does X.0, X.1, X.X and X.not(X) equal? | 0, X, X, 0 |
What does X+0, X+1, X+X and X+not(X) equal? | X, 1, X, 1 |
State what internal components make up a computer system? | The processor, main memory, address/control/data bus and I/O controllers |
State the role of a processor? | The processor responds to and processes instructions and comprises of the control unit, ALU and registers. It follows the Fetch-Decode-Execute cycle for each instruction. |
What does the control bus do? And state its properties. | It is a bi-directional computer bus that is used by the CPU to communicate with devices that are contained within the computer. The control bus carries signals that control the actions of the computer. |
What signals/commands does the control bus carry? | Memory read/write, clock, reset, bus request/grant |
What does the data bus do? And state its properties. | It is a bi-directional computer bus that acts as medium for data to be sent between different components. The wider the bus the greater the performance of the system. |
What does the address bus do? And state its properties. | It is a single direction computer bus (comprising of words) that is used to specify a physical address for internal and external components. The wider the bus, the greater the maximum possible memory capacity is. |
What are I/O controllers? | An I/O controller is a device which acts as an interface between a peripheral and the processor. |
What is the stored program concept? | It is defined as machine code instructions stored in the main memory are fetched and executed serially by a processor that performs arithmetic and logical operations. |
What is Von Neumann architecture? | It specifies that the basic components of the computer and processor share memory and a bus which is used for both data and instructions. This architecture is more common and requires scheduling as the data and the instructions use the same bus. |
What is the Harvard architecture? | It is a computer architecture that uses physically separate memories for instructions and data. This architecture is used predominantly in embedded systems and is quicker as the bus isn’t shared between data and instructions. |
What components is the processor made up of? | The Arithmetic Logic Unit (ALU), the control unit, the system clock, general purpose registers and dedicated registers. |
What does the ALU do? | The ALU performs arithmetic operations such as add/divide and it also performs logical operators such as left shift or AND logic gates. |
What does the control unit do? | It controls and coordinates the activities of the CPU directing the flow of data between the CPU and other components. It accepts the next instruction, fetches the addresses and data from the memory and stores the results in registers/memory. |
What is the system clock? | It is a clock that sends out a series of digital signals which switch between 0 and 1 which synchronises the CPU operations. As the signal changes from 0 to 1 (the rising edge) one operation is carried out. |
What are general-purpose registers? | General purpose registers are registers that can store a data or a memory location address from the results of previous calculations performed by the ALU. |
What is dedicated /special-purpose register? | Special purposes register are registers which are designed for a single task. For example, the PC, CIR, MAR, MBR and SR. |
What does the program counter do (in a processor)? | The program counter (PC) holds the address of the next instruction to be executed. |
What does the current instruction register (CIR) do? | It holds the current instruction while it’s being decoded and executed. |
What does the memory address register (MAR) do? | It holds the memory address of the location from which data is to be fetched from. |
What does the memory buffer register (MBR) do? | It acts as temporary store for data that has be fetched |
What does the status register (SR) do? | It contains the status of the ALU such as whether an overflow error has occurred or whether the result was negative. |
Describe the Fetch part of the Fetch-Decode-Execute cycle? | The address of the next instruction is transferred from the PC to the MAR. The address is sent via the address bus to the main memory. The instruction at that address is sent along the data bus to the MBR while simultaneously the contents of the PC is incremented to hold the next instruction. Lastly the contents of the MBR are copied to the CIR. |
Describe the Decode part of the Fetch-Decode-Execute cycle? | The instruction held at the CIR is decoded. The instruction is split into opcode and operand and additional data is fetched if necessary. |
Describe the Execute part of the Fetch-Decode-Execute cycle? | The instruction is executed using the ALU if necessary and the results are stored in the memory/general purpose registers or the accumulator. |
What is the processor instruction set? | A CPU's instruction set contains the opcodes/instruction in machine code that the CPU will accept such as LOAD, ADD and HALT. Every processor has its own instruction set. |
What does an instruction in the processors instruction set comprise of? | It is made up of OPCODE, the addressing mode and the OPERAND. For example, if the instruction was 8bit, the first 3 bits could be the OPCODE, the next bit the addressing mode and the rest the OPERAND. |
What is the OPCODE in a machine code instruction? | It the part the specifies what operation should carried out. |
What is the OPERAND in a machine code instruction? | It is the address or value which is to be manipulated by the OPCODE. |
What is immediate addressing? | Immediate addressing is when the OPERAND is the actual value to be manipulated. |
What is direct addressing? | Direct addressing is when the OPERAND specifies the memory location of the value to be manipulated. |
What does LDA (load), STO (store) and ADD do in assembly language? | LDA loads a value into the accumulator, STO stores the value in the accumulator into a specified location and add adds a number to the value stored in the accumulator. |
State what factors affect a processors performance and state how? | Having more cores means that the processor can carry out operations simultaneously. Cache is a very small amount of very fast memory that stores data that is likely to be reused a lot and is divided into level 1,2 and 3 caches (1 being the fasted but smallest). Having a faster clock speed means that more operations can be carried out per second. A larger word length means that more bits can be processed at a time. Address/data bus width being wider means that a wider range of addresses can be specified, and more data can be sent at a time. |
How does a barcode reader work and what is it used for? | A light pulse is emitted; the black bars absorb the light and the white bars reflect it back to a sensor in the scanner that a decoder converts to text. They’re used to identify anything at a close range such as a driving licence but can’t scan at a longer range. |
How does a digital camera work? | It has a plate made up of lots of light sensors which are exposed to light when a photo is taken. Each pixel is measured, and an approximate binary value is deduced constructing an image. |
What is Radio Frequency Identification (RFID)? | It is a method of scanning anything from products to animals. It works similar to a barcode scanner but has a longer range and doesn’t require direct sight to be read with a scanner. It can pass data to and from the tag/receiver. |
What are the two types of chips used in RFID? | Active chips are larger as they have a battery so it can in real-time transmit data to receivers. Passive chips require radio-waves to be sent within a couple of metres to power the tag so that data can be transmitted. |
How does a laser printer work? | It generates a bitmap onto a panel which has light shone onto it causing the empty parts of the page to become negatively charged. These negatively charged particles go onto a drum which applies heat and pressure to a piece of paper to transfer the particles onto it. |
Why is secondary storage needed on a computer? | Memory (RAM) has the issue that it is volatile which is why memory known as secondary storage is required to indefinitely store data. |
What is a hard disk, how does it work and state some advantages/disadvantages? | A hard disk is a secondary storage device which comprises of a series of rotating platters (disks) which are coated with magnetic material. These platters are divided into concentric circles (tracks) which are divided into sectors. A head reads/writes off of the rotating disks without being in contact. The advantage is that they have a very large capacity but they’re not very portable and are quite slow. |
What is an optical disk, how does it work and state some advantages/disadvantages? | An optical disk is a secondary storage device that can be read only, recordable or rewritable. A read only disk during its manufacturing has grooves pressed into it (the grooves reflect less light and represents 0’s or 1’s). A recordable disk can be burned to write data into the disk once to produce grooves. A rewritable disk can be rewritten using a magnet to temporarily create grooves. The advantage of disks is that they can be easily distributed and is cheap however they can be damaged quite easily. |
What is a solid-state drive (SSD), how does it work and state its advantages/disadvantages? | It is a secondary storage device which comprises of a controller which controls pages which are made up of blocks. They also contain NAND flash gates. An advantage is that they’re faster and consume less power than hard disks however they can store less data and get damaged quicker. |
What laws have been passed in to regulate the digital age? | The data protection act which states that personal data must remain accurate, up to date and not used in ways that it could harm people. The computer misuse act has also been passed to make it illegal to access/modify a computer without permission. |
What challenges do legislators face in the digital age? | Different countries have different laws and new ways of committing offences are being created which has no legislation. |
How does serial transmission work? | Using serial, transmission bits are sent across a wire one at a time to reach their destination. |
How does parallel transmission work? | Every bit is sent simultaneously down different channel to reach their destination. |
State the advantages of serial transmission over parallel? | It uses up less space and is cheaper. It doesn’t suffer from interference between the wires being so close meaning data can be sent at a higher frequency (faster). It doesn’t suffer from skew meaning it can be sent over larger distances. |
Explain what the baud-rate is. | It is the rate at which a signal changes |
What does bit rate mean? | It is the speed at which data is transmitted serially. |
Define bandwidth. | Bandwidth is defined as the amount of data that can be transmitted in a given time. |
Define latency. | It is the amount of time it takes for a packet of data to get from the requested network to your network. |
Define protocol | It is a set of agreed rules that govern how data should be transmitted. |
What is the relationship between bandwidth and bit rate? | They're directly proportional |
What is synchronous data transmission? | It is when data is sent at regular intervals that are timed by a clocking signal typically used with parallel communication. |
What is asynchronous data transmission? | Asynchronous transmission is when one byte is sent at a time. A start bit synchronises the transmission whereas the end bit acts as a stop period which lasts arbitrarily long. |
Describe how a physical bus topology works? and state its advantages/disadvantages. | All computers are connected to a single cable. An advantage is it very cheap as less cable and no additional hardware is required. On the other hand, a single fault in the wire causes the whole network to crash, performance degrades with heavy traffic and it has low security as all computers see the data being transmitted. |
Describe how a physical star network topology works? and state its advantages/disadvantages. | A central switch or computer acts as a router that has all the MAC addresses of the devices in the network to transmit data to the correct device. Its advantages are that a fault means only one device is affected, it has consistent performance (even with many devices), it has faster transmission speeds, it is more secure and new devices can be added to the network without disrupting the network. |
What is a physical network topology? | It is the actual design of the network in terms of hardware. |
What is a logical network topology? | A logical topology is the shape of the path that the data travels in and states how the components communicate across the topology. |
Are physical and logical network topologies dependant of each other? | No – this means that a physical star network can have a logical bus network (and vice versa) |
What is a local area network? | It is a computer network in which the devices are confined to a single location/building. |
Explain what is meant by a client-server network | It is a network which contains many devices known as clients which are connected to a powerful central computer known as the server. Each client may have its own data which the server holds and manages it for its clients |
Explain what is meant by a peer to peer network | Individual computers are connected to each other over a WAN or LAN so that files can be shared between them |
State the advantages of a client-server network. | Data is more secure as the server holds the data and controls peoples access rights to it. Backups can be made easily. Data/resources can be shared quickly and easily. |
State the disadvantages of a client server network. | They’re expensive to install and maintain. Staff are required to maintain the servers and run the network. |
What is the downside of peer to peer networks? | It is used in piracy as it is impossible to see who is downloading the illegal files. |
What is the purpose of Wi-Fi? | It allows you to connect a device to a network (typically the internet) via a wireless network access point (WAP). |
What components are required to connect to Wi-Fi? | A wireless network interface card (WNIC) and wireless access point is required. |
How can you secure a wireless network? | You can use WPA1/2 which is a security protocol which encrypts the data strongly and also requires a password to be entered. SSID (the network name) can be hidden so that it isn’t broadcasted. Lastly you could whitelist MAC addresses. |
What is CarrierSenseMultipleAccess/CollisionAvoidance with RequestToSend/ClearToSend? | It is a protocol which attempts to avoid collisions on a data channel. Before sending data, the channel is checked if it is busy. If so a random wait period is generated until the channel becomes idle. Next a request to send signal is sent to the destination node and the WAP sends a clear to send signal which counteracts the issue of hidden nodes. |
What is a Service Set Identifier SSID? | It is the name of a Wi-Fi network that is broadcasted to the local area. The broadcasting can be disabled so that the network name needs to be known to connect as well |
What is the difference between definite and indefinite iteration? | In definite loops, the number of iterations is known before the iteration starts whereas in indefinite iteration it is unknown. |
What advantages are there using subroutines? | It decomposes a big problem into a many smaller ones. Code can be re-used, and subroutines also improve the readability of the program. |
How is a stack used in corporation with a sub-routine? | Stacks are used to store info about a subroutine which is hidden from the user in high-level languages. The call stack holds the location address of the instruction that the program should return to at the end of the subroutine (return address). The stack also contains parameters for the routine and local variables are contained as well. |
What does the stack frame of a sub-routine comprise of? | At the top, the local variables are stored followed by the return address and the parameters. Multiple function can be on the frame following the same composition above. |
What is the difference between a global and local variable? | A global variable can be accessed anywhere in a program whereas a local variable can only be called within its respective function. A local variable can be reused throughout the program whereas a global variable can be defined once. |
What is a recursive function? | It is a function that calls itself. |
What features must a recursive algorithm have? | The function must have an end condition, the routine must call itself and the stopping condition must be reached in a finite number of steps. |
State the main differences between procedural (POP) and object-oriented programming (OOP)? | In POP the program is divided into functions whereas in OOP the program is divided into objects. In POP importance is given to the sequence of instructions unlike OOP which gives the importance to data. In OOP new data and functions can be added easily unlike in POP programming. |
What are the advantages to a structured approach for programming? | Complexity of the program is reduced, modules can be reused and it is easier to debug it. |
What is a Class in OOP? | A class is a ‘blueprint’ for creating objects (a data structure) |
What is an object in OOP? | It is a particular instance of a class. |
What is instantiation in OOP? | It is the physical creation of an object. |
What is encapsulation in OOP? | It is the process of combining data and functions into a single unit called a class meaning data cannot be accessed directly but through functions in the class. Encapsulation allows data/information hiding to be possible. |
What is inheritance in OOP? | Inheritance is the process of giving a new class properties of a pre-existing one. For example, a class named fish would inherit properties of a class named animal as a fish is an animal. The base class is the superclass and all of the classes that inherit features from this class are known as sub-classes. |
What is composition and aggregation in OOP? | Both are instances when two or more objects are combined. When a parent class is destroyed when composition is implemented, the sub classes are destroyed (such as if a chair is destroyed, so are its legs)) whereas when aggregation is implemented, the sub-classes may still exist (such as a department may be dissolved but the staff belonging to it aren’t destroyed). |
What is polymorphism in OOP? | Polymorphism is the ability to treat a class of object as if it is the parent class (The parent class is the common interface). |
What is overriding in OOP? | It is when a super class is redefined by one of its sub-classes. |
What features does an OOP class diagram have? | A black diamond line represents composition, a white line represents aggregation a plus is a public specifier, a minus is a private specifier and a hash is a protected specifier. |
What are the main principles of designing a OOP? | Favour composition over inheritance, program to an interface and encapsulate what varies. |
What is a public, private and protected access modifier? | If a method/instance variable is declared private then only code inside the class can access it. If a method/instance is declared public, then code within any class can access it. A protected method/instance variable is when a class cannot be modified by sub-classes. |
What are the advantages of OOP? | There is a faster development time for programs as code is reused and is cheaper to make as it is coded quicker. |
What is a stack? | A stack is an abstract data type (ADT) which follows the first in last out principle (FILO). For example, a stack of plates. |
What is a queue? | A queue is an abstract data type (ADT) which follows the first in first out principle (FIFO). For example, a lunch queue. |
What is an array? | An array is a data structure that contains a group of elements. |
What is a graph and tree? | A graph is a series of nodes (entities) interlinked by arcs/relationships. A tree is a graph that has no cycles. |
What is a hash table? | It is an abstract data type (ADT) that converts a range of key values into a range of indexes for an array. |
What is a dictionary? | It is an abstract data type (ADT) that consists of pairs of keys and values. If a key is entered the value associated with it is returned. |
What is a static and dynamic data structure? | A dynamic data structure is one that can vary in size whereas a static one is fixed. |
What is a queue used for? | Modelling real life problems and holding characters typed in a buffer. |
What four operations can be performed on a queue perform? | enQueue() adds a new item to the end of a queue. deQueue() removes the front item from the queue and returns it. isEmpty() tests to see whether the queue is empty and isFull() tests to see whether it is full. When something joins the queue the end point increases by one and when something leaves the queue the front pointer increases by one. |
What types of queues are there? | Linear (the standard queue), a circular queue (which means memory space can be reused) and a priority queue (which assigns a priority to each item). |
What does pop() do and pop(pos)? | Pop removes the last item from a list and returns it and pop(pos) removes the specified item index and returns it. |
What uses does a stack have? | They hold information when a subroutine is called and the order of pages accessed on a web browser so that forwards and backwards works. |
What five operations can be performed on a stack? | push(item) adds a new item to the end of the stack. Pop() removes and returns the top item from the stack. peek() returns the top item from the stack but doesn’t remove it. isEmpty() and isFull() checks whether the stack is empty or full. |
What issues can occur with stacks? | Underflow error – using pop() on a empty queue - and overflow error – pushing an item on a full queue |
What uses do graphs have? | Graphs can be used to model many types of relations and processes in physical, biological, social and information systems. For example computers networks, roads between towns and states in a finite state machine (FSM). |
What is a weighted and directed graph? | A weighted graph means that the arcs have lengths and a directed graph has arcs with a direction. |
What is an adjacency matrix? | It is a two-way table that lists all the possible relationships in a graph. For a weighted graph, if a box is empty or a dash then the link doesn’t else it represents the weight. If it is an unweighted graph, a one means the relationship exists and a zero means a relationship doesn’t exist. |
What is an adjacency list? | It is a way of representing a graph. One column lists the nodes and the other contains the nodes it’s connected to and the weights if applicable. E.g. A | {B:4,H:8}. |
In a tree graph what is the root node, a child node and a subtree? | The root node is the base node. A node with an incoming node is a child node. A subtree is a set of nodes and edges all coming from a single parent node. |
What uses do trees have? | They’re useful for storing and manipulating hierarchical data and making information easy to search for. |
What is a binary tree and how do you construct one? | It is a rooted tree that each parent node has at most 2 children. To construct one you place the first value as the root node and any subsequent values checking each node seeing whether it is greater or less than the node until a leaf node is reached. |
How do you traverse a binary tree using pre-order traversal? | First visit the root node followed by the left sub-tree and the right sub-tree. This can be achieved by drawing an outline around the tree and each time you pass the left of a node you output the data. |
How do you traverse a binary tree using in-order traversal? | First visit the left sub-tree followed by the root node and the right sub-tree. This can be achieved by drawing an outline around the tree and each time you pass the bottom of a node you output the data. |
How do you traverse a binary tree using post-order traversal? | First visit the left sub-tree followed by the right sub-tree and then the root node. This can be achieved by drawing an outline around the tree and each time you pass the right of a node you output the data. |
How does a binary search tree table work? | First label each node with an index in a table. The left/right pointer points to the index of another that it leads to. A -1 means that no child node exists. |
What is a hashing used for? | It is used to store data in a table so that the data can be accessed quickly. |
What problems do hashing algorithms have and how it this avoided? | Sometimes the algorithm can map different pieces of data to the same key. In this event a step is introduced to store the data in the next available slot also known as rehashing. |
What uses do hashing tables have? | Hash tables are used when implementing a dictionary or searching for a piece of data like a telephone number. |
In what ways can a vector be represented? | It can be written in a list format and they can also be interpreted as a function |
How can vectors be implemented in a programming language? | As a dictionary or list. |
What does a vector addition and multiplication achieve? | Translation and scaling |
What are vectors used for in computer science? | Keeping track of the movement of things and games that have a 2d/3d environment. |
What is depth first search (for a graph) and how is it implemented? | It is an algorithm that goes as far as possible down a route before backtracking and going down other routes. It uses a stack and is recursive. |
What is breadth first search (for a graph) and how is it implemented? | It is an algorithm that explores all neighbour nodes first before moving on to another node/level. It is implemented with a queue and is iterative. |
What uses to breadth and depth first search algorithms have? | Depth first search can be used to find a way through a maze and breadth first search can be used to find the shortest path between two nodes. |
What uses do pre and post order graph traversal algorithms have? | Pre-order makes a copy of a tree and post order can convert infix to reverse polish notation. |
There are no comments, be the first and leave one below:
Want to create your own Flashcards for free with GoConqr? Learn more.