classes, stacks, searches, Flashcards

1
Q

data encapsulation

A

a method of bundling data and the function that uses them

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

data abstraction

A

a mechanism of only exposing interfaces and hiding implimentation details from the user.

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

what is special about all functions declared after public:

A

ther are accessable by any part of the program

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

linear search

A

iterates from ones side to the other until the target is found

requires nothing of the user

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

binary search

A

goes to the middle index, determines which side the item is on, goes to the middle of that one, repeats.

requires the list to be sorted

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

time for binary and linear search

A

logarithamic and linear

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

ADT

A

Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations.

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

converting from an interger to its character code

A

character = value +’0’

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

converting from character value to interger

A

value = character - ‘0’

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

what must be added to each header in stack.cpp

A

stack::

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

how to compile with linked lists

A

clang++ -std= c++11

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

equivalent to headptr -> item = 2;

A

(*headptr).item = 2;

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

equivalent to (*headptr).item = 2;

A

headptr -> item = 2;

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