CSE12 Review Flashcards

1
Q

STDERR

A

is used to display two kinds of messages

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

Unsigned value in C or C++

A

positive

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

Convert 0xa to binary

A

1010

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

0xFF is stored in a signed char, is it positive or negative?

A

NEGATIVE

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

Assuming a 4-bit unsigned word, convert 1111 to hexadecimal

A

0xF

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

using NAMESPACE in C++ is similar to what in JAVA?

A

import

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

Polymorphic generic container (PMGC)

A

When using a polymorphic generic container, the container can manipulate objects only when knowing the types of those objects.

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

Traversal Orders

A

Pre-ORDER Visit Left Right

In-ORDER Left Visit Right

Post-ORDER Left Right Visit

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

Arrays

A

declaring: type name [size] = initialize values

storing data information in array (indexing)

passing array as parameter

zero indexing

errors: out of bound array indexing

continuous RTS memory allocation

char array/ string array (automatic)

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

Java with Generics

A

homogeneous container: compiler enforced design

Item removal was of known type (no casting to true type)

Item to remove was known , not polymorphic

Smaller memory use than c++: benefits for memory limited app

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

Gary HW Outline

A

HW3: Create STACK, not PMGC

HW4: CALL , not PMGC

HW5: LIST , PMGC
STACK, PMGC
MYREC, not PMGC
object structure is simple and representative. Constraint method: copy function, delete function, greater than write. Constructor is not constraint methods

HW6: UCSDstudent, not PMGC
HTABLE, PMGC
VAR, not PMGC
SYMTAB, PMGC

~~ “when object satisfies constructor* , it can be out into PMGC

HW7: Generics
HW9: DISK

HW8: TEMPLATE

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

Disadvantage of Object Oriented Design (OOD)

A

Overkill

Learning Curve: takes time to

debug is challenging: layers make debugging hard to find from implicit call

“magic”: implicit calls to methods and polymorphic generic method, …

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

C with void pointer and function pointer

A

type checking: void pointer

heap memory: memory leak checking

pointer: too many, null check for each

OO syntax: code was not real Object oriented

Complex; so many symbolic elements

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

XORing is used to extra bits

A

FALSE

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

XORing is used to flip bits

A

TRUE

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

Static variables exist what which section of memroy?

A

DATA

17
Q

Mutable

A

language feature of C++ that prefixes to a data field that can change even in a constant object

18
Q

Union:

A

language feature in C and C++ that allows for anonymous unions. An unnamed union when a field us used without a prefix, its is like a struct, except you only get one of teh data fields declared with any one object

19
Q

Linked List

A

Linked list is a container object made up of zero or more nodes

In linked list data/objects is in the heap

Objects are nameless in HW5

void pointers store the data

driver then to myrec then to HEAP

driver 2 then to myrec then to runtime stack (RTS)

20
Q

Hash Table

A

Fair share is ordered hashing .

Look. at application to know what to do to check duplicate insert

21
Q

Lazy remove

A

height does not change, balance does change