Shared Flashcard Set

Details

Programming Languages
Built-in Data, Operators and Expressions, Control Statements and Subprograms
21
Computer Science
Undergraduate 3
04/16/2013

Additional Computer Science Flashcards

 


 

Cards

Term
Primitive Types
Definition
-Data that is not defined in terms of other types
-Usually reflect the hardware types
Term
User-defined Primitives
Definition
-Treated as primitives by the programmer after being defined but are translated to other hardware (integers, chars)
Term
Enumeration Types
Definition
-Keys are translated into integers
Advantages:
-Readability
-Reliability
Term
Subrange Types
Definition
-User-defined type which is a continuous sequence of another discrete type
Advantages:
-Readability
-Reliability
-Storage Optimization
Term
Built-in Data Structures
Definition
-Allow programmer to collect together data elements into a group and get built-in operators for accessing/storing/... elements in the data structure
Term
Arrays
Definition
Homogeneous ordered collection whose data elements are accessed by their position.
Term
Associative Arrays
Definition
Unordered collection of homogeneous elements which are accessed by a key (not position)

Key = unique name associated w/ each value
Term
Records
Definition
Heterogeneous ordered collection of data elements where access/storage is done by a field name

-Structs
Term
Unions
Definition
Heterogeneous ordered collection where elements are referred to by field name but fields all share the same memory area.
Term
List types
Definition
Dynamic length ordered list type
Term
Central Heap
Definition
Heterogeneous unordered collection of unnamed objects which are referenced indirectly
Term
Fragmentation of Heap
Definition
Not enough contiguous space on heap to satisfy a request but enough total space on the free list

fix: system can run a compaction algorithm
Term
Garbage
Definition
Block of space on the heap that is not on the free list but has no active ptr to it (can't be referenced)
Term
Reference Counter Method
Definition
Set up a counter for every allocated block on the heap

Adv:
-Never interrupted to handle garbage

Disadv:
-Continual runtime overhead to handle reference counters
Term
Garbage Collection
Definition
Programming Language system ignores garbage until free list is empty: interrupts your program and runs the garbage collector (gc) which goes through entire heap and decides if a cell is being used or not

Adv:
Only need the runtime overhead gc if you run out of space

Disadv:
Will be interrupted if you run out of space
Term
Side-effects
Definition
Anything an operator/function does other than returning its one final value
Term
Bohm and Jacopini Theorem
Definition
All algorithms can be implemented with only 3 control forms:
1. Sequencing 1,2,3...
2. A 2-way selector
3. A logically-controlled iterator
Term
Static Counter Loop
Definition
The parameter of the loop are evaluated on entrance to loop and stored in registers

-Safest and most reliable
Term
Dynamic Counter Loop
Definition
The loop parameters are reevaluated in each iteration
Term
Procedural Abstraction
Definition
Programmer can collect a section of code together and give it a programmer-generated name

Adv:
1. Saves space: code stored once
2. Saves programmer's time: program/debug code once
3. Organizational Tool: break a complex program into subprograms
4. Allows information hiding: keep details separate from the users of the subprogram
5. Allows reuse of subprograms - libraries
6. Allows recursion and other subprogram forms
7. Allows separate storage and compilation of pieces of program
Term
Subprogram
Definition
Includes:
-Actual code segment - body
-Header info, including
1. name of subprogram
2. parameters
-number
-order/name of parameters
-type
-passing method
3. Direct return value and types
4. Kind of the subprogram
Supporting users have an ad free experience!