progweek3 Flashcards

1
Q

looping

A

the repetition of the same procees multiple
times until a specific condition is satisfied, then it will stop.
Actually, looping can simplify complex problems into simple ones.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

while loops, does or does not depend upon the number of iterations?

A

does not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Recursion is

A

a programming technique in which a function calls itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In recursion, there is a _ that is (are) tested for
_.

A

base case (or cases)

upon entry to the function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In recursion, there is a _ step (or steps) in which one of the variables is
_ in a way that will lead to the base case.

A

recursive

passed as an argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The structure type allows us to :

A

aggregate variables of different types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A header file is

A

a file with extension .h which contains C function
declarations and macro definitions to be shared between several source
files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

here are two types of header files:

A

files that the programmer writes, and

files that comes with your compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In the C language, structures can be _ to functions
and can be _.
You can pass to a self-defined function:

A

passed as arguments

returned from them

individual members,
an entire structure,
or a pointer to the structure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Abstraction is

A

a key mechanism that helps to solve problems in general
and to write cleaner, safer, and simpler programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Computer systems are essentially :

A

stratifications of layers of abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The logic gates in our physical machine take _.

A

continuous signals and
produce a system which works in binary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The operating systems creates _.

A

an abstraction of the physical
machine (e.g., providing an abstract version of the memory of the
system, of each device, etc.).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Modularization:

A

When we have a medium/big problem we want to decompose it in
subproblems and use di↵erent modules to solve each subproblem.
These modules then cooperate to solve the original problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

There are essentially two ways to abstract in our programs (independently
on the language we use):

A

parametrization

specification(API)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Parametrisation:

A

We abstract from some of the data using parameters. E.g., we can define a function bigger(int x, int y) which
works with any integers instead of rewriting the code for each single
pair. This is usually supported by programming languages.

17
Q

Specification (API):

A

We abstract from the implementation. We
separate declaration and implementation. E.g., when we plan our project we only think about the external behavior of each data type
and function. This is usually not supported by the language itself and
is dealt with informally (essentially done via comments).

18
Q

procedural abstraction:

A

We split the problem into subproblems that are solved in separate functions.

We use parameters to make functions solve many problems at the same time (make functions less specific).

We use specification to separate implementation and declaration. When we use a function we do not have access to the implementation but just to its specification (what it does but not how it does it).

19
Q

If we apply abstraction via API to data types we obtain the notion of
_.

A

Abstract Data Type (ADT).

20
Q

A data type is:

A

A collection of objects, e.g.,{. . . , 1, 0, 1, 2, . . .} for int.
A collection of operations, e.g.,+, *,- , / etc. for int.

21
Q

We abstract from the implementation of the data type. So, an abstractdata type consists of:

A

the specification of the abstract values in the type and some of
their properties.

the specification of the operations that allow to create, modify and
use these values.

22
Q

A dynamic length stack (dls) of integers is :

A

a stack whose size can
change dynamically during the execution of the program. The size
changes automatically when elements are added or removed from the stack.

23
Q

dlsInit:

A

Initializes a new empty dls.

24
Q

push:

A

Inserts an element into a given dls.

25
Q

pop:

A

remove the last element that was added to the dls and returns
its value.

26
Q

freeDLS:

A

Frees all the space used by the given dls.

27
Q

specification of the operations:

A

dlsInit

push

pop

freeDLS

28
Q

self-referential structure is

A

a structure that contains a pointer member to a variable of the same type.

29
Q

linked list:

A

It is a set of dynamically allocated nodes. Each node contains one value
and one pointer. The pointer always points to the next member of the list.

30
Q

A local pointer variable is

A

used to held the list. It points to the first
element of the the list. If that pointer is NULL, then the list is considered
to be empty.

31
Q

Array / Linked list

A

stored in a contiguous location/ not stored in a contiguous location

fixed in size/ dynamic in size

memory allocated at compile time / memory allocated at run time

elements may be accessed easily / element accessing may require traversal of the whole list