Shared Flashcard Set

Details

Data Structures & Algorithms 2
2nd year comp sci terms
47
Computer Science
Undergraduate 2
04/22/2013

Additional Computer Science Flashcards

 


 

Cards

Term
RandomAccessFile
Definition
seek()
read(byte b)
write ()
multipurpose RAF
Term
PrintWriter
Definition
text output
Term
Strongly Typed Language
Definition
every variable has a type
every value has a type
Term
Wide vs. Narrow Types
Definition
Wider types can hold more narrow types, but problems occur when casting wider types to narrower types.
Term
Static Type
Definition
The initial type with which a variable is declared.
Term
Dynamic Type
Definition
A legal subclass of the static type that a variable LATER becomes.
Term
Parameterized Type
Definition
uses the 'new' keyword Frog f = new Frog();
Term
Raw Type
Definition
a generic class /type assignment
Term
Abstract Class
Definition
has implemented and unimplemented methods. It is illegal to declare an object of an abstract class.
Term
Interface
Definition
Kind of like an abstract class but with no implemented methods. All variables are public static final.
Term
Polymorphism
Definition
when a same method call invokes different actual methods
Term
Little Endian
Definition
LSB first
Term
Big Endian
Definition
MSB first
Term
Middle/Mixed Endian
Definition
mixed convention
Term
The case in which BF(y) = 0 and the node is deleted on the right of X
Definition
R0 case, involves single clockwise rotation
Term
The case in which BF(y) = -1 and the node is deleted on the right of X
Definition
R-1 case: involves single clockwise rotation
Term
The case in which BF(y) = 1 and the node is deleted on the right of X
Definition
R1 case : involves double rotation, S4 & s5
Term
The case in which BF(y) = 0 and the node is deleted on the left of X
Definition
L0 case: involves single counterclockwise rotation
Term
The case in which BF(y) = -1 and the node is deleted on the left of X
Definition
R-1 case: involves single counterclockwise rotation
Term
The case in which BF(y) = 1 and the node is deleted on the left of X
Definition
R1 case : involves double rotation, S4 & s5
Term
keyboard focus
Definition
if a component has keyboard focus, the key hit is associated with the component
Term
GUI Procedure
Definition
1. public class xxx EXTENDS JFRAME 2. invoke super constructor and pass a literal string title 3. Instantiate a canvas 3. setpreferredsize of canvas and pass it a dimension 4. (anywhere) make the drawing surface class EXTENDS JCOMPONENT, has a paint method that takes Graphcs g 5. Add component 6. Pack 7. Set default close operation 8. Setvisible
Term
GUI Procedure
Definition
1. public class xxx EXTENDS JFRAME 2. invoke super constructor and pass a literal string title 3. Instantiate a canvas 3. setpreferredsize of canvas and pass it a dimension 4. (anywhere) make the drawing surface class EXTENDS JCOMPONENT, has a paint method that takes Graphcs g 5. Add component 6. Pack 7. Set default close operation 8. Setvisible
Term
GUI Procedure
Definition
1. public class xxx EXTENDS JFRAME 2. invoke super constructor and pass a literal string title 3. Instantiate a canvas 3. setpreferredsize of canvas and pass it a dimension 4. (anywhere) make the drawing surface class EXTENDS JCOMPONENT, has a paint method that takes Graphcs g 5. Add component 6. Pack 7. Set default close operation 8. Setvisible
Term
Event source (GUI)
Definition
the event source is the component involved in an event
Term
Quicksort (method, complexity, and special cases)
Definition
divide & conquer, O(nlogn),
Term
sum from i=1 to N of i
Definition
N(N+1)
_________
2
Term
sum from i=1 to N of i^2
Definition
N(N+1)(2N+1)
_______________
6
Term
sum from i=1 to N of i^3
Definition
N(N+1)
[ ________ ] ^2
2
Term
sum from i=0 to N of 2^i
Definition
2^(N+1) -1
Term
Complexity of Mergesort
Definition
Guaranteed Nlog2N. To compute, analyze merging steps vs. non merging steps in an array that has n = 2^k elements.
Term
Lossy Compression
Definition
cannot be reconstituted bit-for-bit, used in media
Term
Losless compression
Definition
can be reconstituted bit-for-bit, used in files
Term
Prefix-free codes
Definition
a prefix free set of codes means any compressed file can be unambiguously decompressed. No code is a prefix of any other code.
Term
Separate Chaining (open hashing/ closed addressing/ external chaining)
Definition
each table entry is just a reference to a linked list. each k,v pair that hashes to k index is put in that linked list.
Term
Open Addressing (closed hashing)
Definition
if location f(k) is occupied, use constant rule to look for another location. No extra space outside table, LF means more, collisions are important, each additional addressing adds o(1) REQUIRES COLLISION RESOLUTION PROBING
Term
Linear Probing
Definition
if we have a collision at location x, then try x+1, x+2, x+3, until a free spot is found (%wrap around if needed).
Term
Primary Clustering
Definition
when sequences of consecutive locations are all occupied. A normal consequence of linear probing.
Term
Quadratic Probing
Definition
if location x is occupied, try location x+n^2, f(x+2), f(x+4), f(x+16) avoids primary clustering may result in secondary clustering
Term
Secondary Clustering
Definition
two keys hash to the same locations, but afterwards, also proceed to jump to the same locations post-attempted-resolution.
Term
Double Hashing
Definition
despite hashing to the same locations, the keys are STILL DIFFERENT. therefore, if a collision is detected, inputting the same keys to a second, entirely different hash function may be warranted.
Term
LZW Decompress

IF IN:
IF NOT IN:
Definition
IF IN: print the corresponding characters and add the previous key plus the first character of the current key to the dictionary.

If not in: print the previous key plus the first character of the previous key and also add this to the dictionary.
Term
Complete tree
Definition
all nodes have either 0 or 2 children. Complete trees are always logN height.
Term
Comparison Sorting
Definition
Atomic sorting, single comparisons
Term
In Place Sorting
Definition
only uses a constant amount of extra space
Term
Stable Sorting
Definition
only applies if we are sorting objects with multiple internal values, we are sorting based on one of those vals. If two objects with the same key appear in an array, after sorting they will be in the same position relative to eachother.
Term
Greedy Algorithm
Definition
the idea is that at each step of the algorithm, you make the choice that looks best RIGHT NOW at the moment. "locally optimal choices"
Supporting users have an ad free experience!