Topic 4 Computational Thinking (copy)

0.0(0)
studied byStudied by 7 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/83

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

84 Terms

1
New cards

Decision Making Process

  • Identification

  • Development

  • Selection

  • Implementation

2
New cards

Ways to express an algorithm

  1. Simple English (Not very common bc it is verbose and ambiguous)

  2. A flow chart (avoids issues of ambiguity)

  3. Pseudo code (combines programming language and written language)

  4. Programming Language (ways to communicate with a computer system)

3
New cards
<p>What does this symbol mean in flowcharts?</p>

What does this symbol mean in flowcharts?

Input/Output

4
New cards
<p>What does this symbol mean in flowcharts?</p>

What does this symbol mean in flowcharts?

If/While/For

5
New cards
<p>What does this symbol mean in flowcharts?</p>

What does this symbol mean in flowcharts?

Start/end

6
New cards
<p>What does this symbol mean in flowcharts?</p>

What does this symbol mean in flowcharts?

Declaration/Assignment

7
New cards
<p>What does this symbol mean in flowcharts?</p>

What does this symbol mean in flowcharts?

Call a method/function

8
New cards
<p>What does this symbol mean in flowcharts?</p>

What does this symbol mean in flowcharts?

Connector

9
New cards

Psuedocode

Meant to help programmers develop computer programs. The syntax used is not as strict as the one used in computer languages.

10
New cards

Top down design or stepwise refinement

breaking up the problem into smaller sub problems, very effective and efficient.

11
New cards

Iteration

Process of repeating a series of instructions. It is extremely useful in programming and is used to repeat a statement or a block of statements within an algorithm.

12
New cards

Conditional Statement

Performs different instructions depending on a Boolean test.

13
New cards

If - then - else conditional statement

When an If is used, the boolean condition must be evaluated before executing the statements. Otherwise it will continue to the else statement, if there is no else then it will move to the end if.

14
New cards

Logical rules or Rules of Inferenece

Programming and algorithmic thinking involves the translation of these rules into algorithms.

15
New cards

Input

Something that is put into a program

16
New cards

Output

Something that is produced by the program after a process

17
New cards

Pre-Planning

the process of planning something in advance

18
New cards

Prefetching

broad terms means getting data or instructions from memory into the cache before they are actually needed. When a program requests data that was previously pre-fetched, it can use the pre-fetched data and continue with execution.

19
New cards

Gantt Chart

type of bar chart. It is widely used for project schedule and project management, as a way of showing activities, tasks, and events against time. On the left of the chart is a list of the tasks, activities, and events. Along the top is an appropriate time scale.

20
New cards

Exception

an act or event that disrupts the anticipated flow of the program’s execution. The exception take place during the execution of the program and can be effectively handled by specific mechanisms that most modern programming languages provide.

21
New cards

Concurrent Processing

The execution of different instructions simultaneously by multiple processors so as to achieve the best performance.

22
New cards

Simplified explanation

programs are broken down into procedures and procedures are broken down to sub-procedures.

23
New cards

Abstract Thinking

reflecting on events, ideas, attributes and relationships in a general manner that hides all unnecessary details of specific objects. All information that is not necessary to accomplish a goal is removed and ignored and a generalization technique is implemented.

24
New cards

Object - Oriented Programming

Uses abstraction and is based on the principle that everyday tasks can be considered as entities.

25
New cards

Collection

A data structure that consists of the data and the predefined methods which operate on the data. Some collections allow custom specification of the collection item elements.

26
New cards

Abstract Data Type (ADT)

Group of operations and data.

27
New cards

Mathematical Modeling

Process where a system is understood well enough and scientists describe it using mathematical language. A set of mathematical rules is used to describe the function of the particular system. It is clear that the mathematical model is an abstraction of the real system.

28
New cards

Array

can hold multiple data elements of the same type. An array has a name, a static size, and a data type. 1-D arrays are linear.

29
New cards

Parallel Arrays

Data organized as a table. Each row represents a particular student and all columns are of the same data type.

30
New cards

Array of Objects

Array of reference variables. Each reference variable is an element of the array and it’s a reference to an object.

31
New cards

Binary Search

Searching method used only in sorted arrays. Relies on divide and conquer strategy to accomplish its purpose.

  • It works by comparing the target value to the middle

  • If they aren’t equal, the lower of upper half of the array is eliminated depending on the results and the search is repeated in the remaining sub-array until it is is successful

32
New cards

Sequential or Linear Search algorithm

Very simple method to find a particular element in an array. Considered to be the simplest search algorithm. Does not require the use of a sorted arrays and it relies on brute force strategy to accomplish its purpose.

  • Starts with the first element and compares each element to the one it’s looking for, until it is found

33
New cards

Advantages of Concurrent Processing

  • Increase computation speed

  • Increases complexity of programming language and hardware (machine communication)

  • Reduces complexity of working with array operations within loops, conducting parallel searches in data based, sorting files, etc.

34
New cards

Reasons for Gantt Charts

  • Efficient organization; helps establish timeframe

  • Highly visual, easy to stick to

35
New cards

Reasons Against Gantt Charts

  • Potentially over complex

  • Needs to be constantly updated if project requirements change

  • Doesn’t show whole picture; details of task

36
New cards

Batch processing

Large amount of input happens over time, then whole set of input is processed in one go

37
New cards

Online Processing

Input processed almost immediately

38
New cards

Real-time processing

Input processed immediately and continuously; generally without any user input, of which comes from system sensors

39
New cards

Types of Flowcharts

  • Algorithm Flowchart: each process represented by a flowchart symbol, started in detail

  • System Flowchart: most basic, general overview of the system itself, with no detail

40
New cards

Bubble Sort (“Swap to Sort”)

Repeatedly steps through the array to be sorted. It compares adjacent items and exchanges them if they are not in the correct order (ascending or descending). The algorithm makes multiple passes until no swaps are necessary and the elements of the array are sorted.

41
New cards

Selection Sort (Sublist to Sort)

Very simple and inefficient sorting algorithm that divides the input array into two sub arrays: the first array are already sorted elements and the second sub-array contains the unsorted elements and occupies the rest of the array.

42
New cards

Generic Collections

Can only hold data of the same elements

43
New cards

Non Generic Collections

can hold elements of different data types.

44
New cards

Advantage of Collections

They can hold different data types and can act like a resizable array

45
New cards

addItem(data)

Used to add an item in the collection

46
New cards

getNext()

return the first item in the collection when it is called

47
New cards

resetNext()

starts at the beginning

48
New cards

hasNext()

tells whether there is another item the list

49
New cards

isEmpty()

check whether collection is empty

50
New cards

What are the predefined sub-programs (Collection Methods)

  • addItem()

  • getNext()

  • resetNext()

  • hasNext()

  • isEmpty()

51
New cards

Efficiency

The amount of the computer resources required to perform its functions. Minimizing the use of various resources such as the CPU and computer’s memory is very important

52
New cards

Correctness

the extent to which the algorithm satisfies its specification, free from faults, and fulfills all objectives set during the design and implementation phase

53
New cards

Reliability

the capability of the algorithm to maintain a predefined level of performance and perform all required functions under stated conditions, having a long mean time between failures

54
New cards

Flexibility

the effort required to modify the algorithm for other purposes than those for which it was initially developed

55
New cards

Big O notation

measure of the efficiency of an algorithm. O(n), where n is the number of times am algorithm was executed.

56
New cards

flag

a variable used to indicate a condition. when the condition is changed the value of the flag is changed. Usually a Boolean variable and is used to terminate a loop.

57
New cards

Lists

used to store a sequence of values under s single name. Allow duplicated to act as containers and to be typically implemented either as linked lists or as arrays.

58
New cards

Fundamental Operations

  • Add

  • Compare

  • Retrieve

  • Store

59
New cards

Compound Operations

Combining fundamental computer operations. Example: find max.

60
New cards

Semantics

The meaning of every construction that is possible in the language

61
New cards

Syntax

Structure of a programming language

62
New cards

Assembler

used to convert the assembly language mnemonics to machine code

63
New cards

High Level Programming Language

Programming language that uses elements of natural language, is easy to use, facilitates abstraction by hiding significant areas of computing systems, and makes the program development simpler, faster, and more understandable.

64
New cards

Compiler

When a high-level language is translated into lower-level language. Translation into machine code for final execution.

65
New cards

Interpreter

When a high-level language is translated into an intermediate code which will be immediately executed by the CPU (done line by line). Warns syntax error, shows outputs for tested processes.

66
New cards

Variable

a storage location for data in a program. They are a way of naming a memory location for later usage. Each variable has a name and a data type that is determined at its creation and cannot be changed

67
New cards

Constant

an identifier with an associate's value which cannot be altered by the program during execution. Opposite of a variable (putting “final”)

68
New cards

Operator

A set of characters which represents an action. Types:

  • Boolean: (And/Or && ||)

  • Arithmetic Operators: (± div mod)

  • Assignment Operator: =

  • Relational Operators: (>, ==, !=, .equals())

69
New cards

Object

comprised of data and actions. Actions refer to the operations that can be performed by the object. Object data may include a number of data members, while actions may also be referred to as methods.

70
New cards

=

is equal to. Used to assign a value to a variable. Min = 6.

71
New cards

≠

not equal to. Min ≠ Max

72
New cards

>

is greater than

73
New cards

>=

is greater than or equal to

74
New cards

<

less than

75
New cards

<=

less than or equal to

76
New cards

div

“integer part of quotient”

77
New cards

mod

modulo operation. Calculates the remainder of division of one number by another.

78
New cards

Scope

the visibility of that variable. It defines which parts of the algorithm can store, access, and retrieve the data of the variable.

  • Global variable is visible to all parts of your program

  • Local Variable has limited scope.

79
New cards

Container/Collection

Consisted of 0 or more elements such as objects and values. It is equipped with the necessary operations to handle data. Collections allow duplicate elements and may contain ordered and unordered data elements.

80
New cards

Sub-Program

unit that contains a sequence of computer instructions that perform a specific and pre-defined task

81
New cards

Code reuse

allows programmers to take advantage of existing code and solutions developed by other programmers to speed up their tasks. Code reuse saves time and resources and allows for the completion of demanding projects in the shortest period of time

82
New cards

Software LIbraries

Contain sub-programs that can be used by different types of programs

83
New cards

Advantages of Breaking Program into Sub-Programs

  • Breaking down a complex programming job into simpler jobs

  • Distributing a very large programming problem among various programmers all over the world

  • Enabling code reuse across multiple programs

  • Facilitation of abstraction by hiding implementation details from uses of the subprogram

  • Improving maintainability and traceability

  • Reducing programming code duplication within the same program

84
New cards

Advantages of Using Collections

  • The methods of collections are predefined algorithms that the programmer can immediately use

  • Performance is increased by the data management capabilities provided by the collection

  • Software reuse is facilitated because the use of methods is based on a common language and standard interface.