Algorithms and Programming Flashcards
What is concurrent thinking
Using Concurrent processing to solve a problem (i.e run a program)
What is concurrent processing
Completing multiple tasks at any given time, used by multicore processors for multitasking.
(Alternating between multiple tasks so quickly to give off an impression that one processor is executing multiple instructions simultaneously.)
Multithreading
Technique used by multicore processors where each processor executes thread (application) for a set period, like round robin.
Advantages of concurrent processing
More efficient use of processor time as processor is not idle
Fewer hardware bottlenecks, programs become more responsive as idle time between hardware interactions is filled.
More efficient processing of interrelated tasks.
Drawbacks of concurrent processing
If more than one application is competing for the same resource ( like a hardware component) then there is no change in performance as compared to serial execution.
Can cause deadlocks if there are two processes simultaneously competing for the same two resources.
Problem recognition
Identify the nature and parameters of the problem
Undertake a thorough analysis of the current situation
Specify the problem requirements or success criteria
Identify whether the specifics of the problem allow it to be classified as a certain type of problem
Backtracking
Used in solving a problem that involves examining more than one solution, possible options are checked, and decision is made for which option to take. At final state, then ‘backtracks’ to previous state to see other options.
used in post order DF traversal
Data Mining
extracting valuable information from large data sets; it can be thought of as turning data into knowledge. This is achieved by revealing unnoticed patterns and discovering underlying relationships within the data
involves a variety of techniques, including statistical analysis and machine learning.
Performance modelling
evaluating if a system or a program works as expected or not before it is released, and using this knowledge to make it more effective
How to achieve performance modelling
produce a set of success criteria and test scenarios, and then measure the performance of the system or program against them (i.e testing a program with erroneous data to see if it produces an error)
simulate real-life circumstances and check how well the system or program operates — usually to validate the robustness of a system when there is high demand (can evolve to stress testing to find breaking point of system
Pipelining
when a task is divided into a series of subtasks, where each subtask leads to the next. This means that each subtask is executed by a different process in a series, so that the result of a process feeds into the next one, and this is repeated until the whole task is completed
Advantages of performance modelling
Safe
inexpensive
less time consuming
Features of IDEs
Stepping:monitor effect of single line of code by executing single line at a time
Variable Watch: observe how contents of a variable change within a program
Debugger: run time detection of errors to show line numbers of errors and type of error occurred.
source code editor: Makes coding easier via autocompletion syntax highlighting and auto bracket completion
breakpoint: Set a point where the program will stop to help pinpoint where error occurs
DFS and BFS
DFS uses stack BFS uses queue