Test #1 Flashcards

1
Q

ADT

A

An abstract data type (or ADT) is a class that has a defined set of operations and values

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

5 characteristics of good algorithms

A

1) clear, concise, easy to maintain
2) come to an end (unlike shampoo algorithm)
3) use finite amount of memory
4) require no intelligence or insight to execute
5) have shortest runtime compared to others

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

Big-O

A

O(n) ; <=

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

Omega-O

A

> =

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

Theta-O

A

=

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

little-o

A

<

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

Pass by Value

A

sending a value into an argument makes a copy of that value, so the original value is not changed throughout the function

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

Pass by Reference

A

sending a value into an argument with an & makes the function modify the address of the value, therefore making changes to the original value throughout the function

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

struct vs class

A

struct variables and methods are public by default while class variables sand methods are private by default

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

specification vs implementation file

A

specification file is where class methods are defined and implementation file is where they are filled

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

why are all arrays pass by reference

A

because you can access and modify the elements in the array, and the changes will be made in the original array because you are passing the memory address

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

algorithm

A

step - by - step procedure for solving a problem or computing a task

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

program

A

set of instructions for a computer to follow to perform a task

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

data type

A

type of data a variable can hold

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

data structure

A

formats used to organize, store, and manage data

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

What trade-offs do we often have to make?

A

make the runtime of a program longer in order to make it more robust and easier to follow

16
Q

why is the shortest code segment not necessarily the best?

A

The shortest code segment will be unreadable for someone else trying to follow your code. also leads to more bugs and harder time debugging

17
Q

Memory Leak

A

when dynamic memory Is allocated but not deleted when finished

18
Q

dangling pointer

A

pointer that points to invalid data or data that is no longer valid

19
Q
A