7 Algorithm design and problem solving Flashcards
What are some different types of programming languages?
Declarative, object-oriented, event driven, procedural
What is a declarative programming language?
Language where rules are declared, you can ask questions, answer given based upon the rules
What is an object-oriented programming language?
Language where user can create objects that have attributes and methods
What is an event driven programming language?
A language where there are buttons, text boxes and items user can interact with, each item has its own code which is only run when the item is clicked or changed, all code of program not run from start to finsih
What is a procedural programming language?
Language with statements run in order they are written in, uses subroutines which can be called from other parts of the program
What is the program development life cycle?
A series of structured steps followed to produce a system
What are some different varieties of the program development life cycle?
Cyclic, spiral, waterfall and rapid development
What are the stages of the program development life cycle?
Analysis, design, coding and testing
What is decomposition?
The process of taking a problem or system, and splitting it into smaller parts (sub-problems, sub-systems) which it turn can be split into smaller parts
What is the analysis stage of the program development life cycle?
The first stage of the cycle where the problem is investigated
What is the design stage of the program development life cycle?
The second stage of the cycle where the program is planned out and the problem is decomposed
What things can be used in the design stage of the program development life cycle to plan out the program?
Structure diagram, flowcharts and pseudocode
What is a structure diagram?
A hierarchical diagram that shows a decomposed system, the name of the program at the top and its subprograms below
What is a flowchart and what are its components?
A diagrammatic representation of an algorithm with symbols for decisions, processes, start / stop points, inputs / outputs and arrows to show the direction of flow
In a flowchart, how is the content inside each box written?
Written as words or pseudocode statements
In a flowchart, what is the symbol for a each thing?
Start / stop - curved rectangle thing, process - rectangle, input / output - parallelogram, decision - diamond (think)
What is pseudocode?
Code-like statements used to design an algorithm but do not follow any specific language
What is important in pseudocode and what can be imperfect?
Logic is important, syntax can be imperfect
What is the coding stage of the program development life cycle?
The third stage of the cycle where a program is written in a programming language, includes iterative testing while program is being developed
What is the testing stage of the program development life cycle?
The fourth stage of the cycle where a program is repeatedly used with test data to ensure it fully works, doesn’t crash and meets all requirements
What are the four types of test data and what are their details?
Normal - data program should accept, abnormal - data program shouldn’t accept, extreme - data on edge of what is accepted, boundary - data on edge of being accepted and rejected
What is a search algorithm?
An algorithm which checks a set of data to see if a specific value exists in it or not
What is a sorting algorithm?
An algorithm which takes a set of data and rearranges it to be in a specific order
What is linear search?
A search algorithm which checks each item one at a time, and keeps continuing to the next item until it finds the data it is searching for or reaches the end