C.1 System design concepts Flashcards
Explain how knowledge of data structures, algorithms ad programming influence system change.
What are information systems designed as?
Interacting collections of computer programs
What do computer programs consist of?
Collections of instructions that tell the computer how to interact with the user and undertake specific functions
Define algorithms in the context of computer programs.
Rules used for calculation or problem-solving based on particular representations and structures of data
What do data structures enable?
Accurate representation of data relationships and efficient data usage
List some examples of data structures.
- Arrays
- Linked lists
- Stacks
- Queues
- Trees
- Graphs
- Tables
- Sets
How do arrays organize data?
Store elements of the same type in a specific order and accessed by indexing
What characterizes a stack data structure?
Last element in is the first one out (LIFO)
Describe the queue data structure.
First-in, first-out (FIFO) rule for processing elements
What is the structure of a tree in data structures?
Starts with a root value and branches into sub-trees of children
Define graphs in terms of data structures.
Comprise sets of ordered pairs called edges/arcs and entities called nodes/vertices
What is the purpose of tables in data structures?
Store elements that can be inserted, searched for, or deleted
What is a set in data structures?
Stores certain values without any particular order and no repeated values
How does a binary tree improve search efficiency?
Reduces the average search steps compared to linear search
What are the average search steps using linear search versus binary search for n items?
- Linear Search: n/2 steps
- Binary Search: log2n steps
What are data types?
Data that share a specific property, such as integer, Boolean, alphanumeric characters, or strings
What do algorithms manipulate?
The data contained in data structures
Define an algorithm.
An explicit, precise, unambiguous, mechanically-executable sequence of elementary instructions
What are conditionals in algorithms?
Different steps based on whether a specified Boolean condition evaluates to true or false
What is recursion in algorithms?
A solution to a problem depends on solutions to smaller instances of the same problem
What is abstraction in problem-solving?
Identifying the underlying abstract problem devoid of unnecessary detail
What is the role of programming languages?
Express algorithm(s) and data structure(s) in a particular programming language
How do compiled languages work?
Programmer writes general instructions, and a compiler translates these into machine language
What is the difference between compiled and interpreted programming languages?
Compiled languages translate code before execution, while interpreted languages translate code during execution
What marked the shift from low-level programming to procedural programming?
Higher-level programming languages that allowed writing programs using familiar terms
Define the structured programming paradigm.
A subset of procedural programming that deconstructs problems into smaller components
What is functional programming focused on?
Modeling the problem rather than the solution using functions that depend only on their inputs
What is object-oriented programming?
Models problems in terms of entities (objects) that have attributes and behaviors
List the key characteristics of object-oriented programming.
- Class
- Abstraction
- Encapsulation
- Inheritance
- Polymorphism
What do multi-paradigm languages aim to achieve?
Leverage constructs from different paradigms for specific problems
How have modern programming languages evolved?
More abstract from the machine and improved in usability and efficiency
What is the primary goal of object-oriented programming?
Facilitates disciplined software development process and enables building secure programs through data-hiding concept
Object-oriented programming enhances reusability, extensibility, reliability, and maintainability.
Name two examples of object-oriented programming languages.
- Smalltalk
- Eiffel
These languages exemplify the principles of object-oriented programming.
What do multi-paradigm languages aim to achieve?
Leverage constructs from different paradigms to make a program that suits the nature of a specific problem
Examples include C++, Leda, Common Lisp, and Scala.
How have modern programming languages evolved over time?
More abstract from the machine and closer to human thinking, addressing complex, real-world problems
This evolution spans over more than five decades.
What are the common components of structured programs?
- Statements to establish the program’s start
- Declaration of variables
- Blocks of code
These components create a consistent overall pattern in structured programming.
Why are variables declared at the program’s start?
The compiler needs to know the type of data stored in it in advance
Variables are named to be referred to and typically store values of a given data type.
What is Boolean logic?
A two-valued logic allowing only two truth values – ‘true’ and ‘false’
Boolean expressions consist of logical operands and logical operators.
What are the basic logical operators in Boolean logic?
- AND
- OR
- NOT
- EQV (logical equivalence)
- NEQV (logical non-equivalence)
Boolean expressions often involve comparison operators as well.
What types of control statements exist in programming?
- Sequential
- Decision (conditional)
- Iterative
These control statements dictate which code sections are executed.
What is the purpose of decision (conditional) control statements?
Controls which block of code is executed based on ‘if… then …else’ logic
The ‘if’ block executes when the condition is true, else the ‘else’ block executes.
What are the main categories of iterative control statements?
- FOR loops
- WHILE/DO loops
These loops control how many times a block of code is executed.
What is the structure of a simple FOR loop?
- Initialisation
- Condition
- Increment or decrement
These components define the execution of the loop based on counting.
How do WHILE and DO loops differ from FOR loops?
WHILE and DO loops repeat while a condition is true, while FOR loops specify a count
The condition is a Boolean expression that determines the loop’s execution.