Podcast
Questions and Answers
What is an abstract class?
What is an abstract class?
A partial or incomplete class that contains bodies for some but not all of the methods of the interfaces it claims to implement.
What does it mean to factor out common code?
What does it mean to factor out common code?
It means that method bodies that can be written once and work for any implementation of NaturalNumberKernel have been moved into an abstract class.
Can you instantiate an abstract class?
Can you instantiate an abstract class?
False (B)
What does UUT stand for?
What does UUT stand for?
How do you achieve single-point control over change in constructor calls?
How do you achieve single-point control over change in constructor calls?
What type of class ends with 'L'?
What type of class ends with 'L'?
What is an instance variable?
What is an instance variable?
Criteria for kernel implementation include __________ and __________.
Criteria for kernel implementation include __________ and __________.
What does Sequence3 on Stack refer to?
What does Sequence3 on Stack refer to?
What is the client view in software?
What is the client view in software?
What is the implementer view in software?
What is the implementer view in software?
What is the abstract state space?
What is the abstract state space?
What is a concrete state space?
What is a concrete state space?
What is the abstraction function?
What is the abstraction function?
What is the representation invariant?
What is the representation invariant?
Why hashing?
Why hashing?
Nodes in a linked list must always have consecutive memory addresses?
Nodes in a linked list must always have consecutive memory addresses?
Nodes in a linked list can be accessed in constant time?
Nodes in a linked list can be accessed in constant time?
Nodes in a linked list require at least one smart node?
Nodes in a linked list require at least one smart node?
Nodes in a linked list can be accessed sequentially in linear time?
Nodes in a linked list can be accessed sequentially in linear time?
The process of building a heap will completely sort its elements?
The process of building a heap will completely sort its elements?
A subroutine is needed to adjust the root of a subtree to its proper position, assuming the subtree is a heap except for its root.
A subroutine is needed to adjust the root of a subtree to its proper position, assuming the subtree is a heap except for its root.
Heaps are parameterized by a type and an ordering process?
Heaps are parameterized by a type and an ordering process?
A heap is a binary tree with extra constraints on its shape and organization?
A heap is a binary tree with extra constraints on its shape and organization?
What is a collection type?
What is a collection type?
What are some examples of collection types?
What are some examples of collection types?
What are the pros of using arrays?
What are the pros of using arrays?
What are the cons of using arrays?
What are the cons of using arrays?
How is an array represented?
How is an array represented?
What does JVM stand for?
What does JVM stand for?
What is a binary tree?
What is a binary tree?
List the traversal orders for binary trees.
List the traversal orders for binary trees.
What is a Binary Search Tree (BST)?
What is a Binary Search Tree (BST)?
What is a sorting machine?
What is a sorting machine?
Why is a sorting machine better than a regular sort?
Why is a sorting machine better than a regular sort?
Smart nodes can prevent run-time errors arising from the code managing of a linked list?
Smart nodes can prevent run-time errors arising from the code managing of a linked list?
Smart nodes can provide faster performance when manipulating elements of a linked list?
Smart nodes can provide faster performance when manipulating elements of a linked list?
Smart nodes can make initial setup of the linked list faster?
Smart nodes can make initial setup of the linked list faster?
Smart nodes can aid removal of special cases from some methods that work with a linked list?
Smart nodes can aid removal of special cases from some methods that work with a linked list?
What is the data structure of a doubly-linked list?
What is the data structure of a doubly-linked list?
What is TF in relation to interfaces?
What is TF in relation to interfaces?
What does the standard method newInstance() do?
What does the standard method newInstance() do?
What is the role of the server in BugsWorld?
What is the role of the server in BugsWorld?
What is the role of the client in BugsWorld?
What is the role of the client in BugsWorld?
What do displays show in BugsWorld?
What do displays show in BugsWorld?
What are the 3 parts of a compiler?
What are the 3 parts of a compiler?
What is an Abstract Syntax Tree (AST)?
What is an Abstract Syntax Tree (AST)?
What is a statement in the context of ASTs?
What is a statement in the context of ASTs?
What are the 5 kinds of statements?
What are the 5 kinds of statements?
You can use == to test equality of enums?
You can use == to test equality of enums?
What is an Enumeration (Enum)?
What is an Enumeration (Enum)?
What is a statement no-arg constructor?
What is a statement no-arg constructor?
What is a program in the context of BL?
What is a program in the context of BL?
What are the 3 components of a program model?
What are the 3 components of a program model?
What is refactoring?
What is refactoring?
What is a Context-Free Grammar (CFG)?
What is a Context-Free Grammar (CFG)?
What is a Recursive-Descent Parser?
What is a Recursive-Descent Parser?
What are terminal symbols?
What are terminal symbols?
What are non-terminal symbols?
What are non-terminal symbols?
What is a metagrammar?
What is a metagrammar?
What is a derivation?
What is a derivation?
What is ambiguity in the context of CFG?
What is ambiguity in the context of CFG?
What is a token?
What is a token?
The purpose of a tokenizer is to transform source code into machine/object code?
The purpose of a tokenizer is to transform source code into machine/object code?
The purpose of a tokenizer is to remove whitespace and separate the source code into small, meaningful units?
The purpose of a tokenizer is to remove whitespace and separate the source code into small, meaningful units?
The purpose of a tokenizer is to construct an abstract representation of a program?
The purpose of a tokenizer is to construct an abstract representation of a program?
What does a BL tokenizer do?
What does a BL tokenizer do?
What are the two main uses of CFGs?
What are the two main uses of CFGs?
What is parsing?
What is parsing?
What are the 5 rules of a recursive-descent parser?
What are the 5 rules of a recursive-descent parser?
What do CFG symbols { } indicate?
What do CFG symbols { } indicate?
How does the parser evaluate an arithmetic expression?
How does the parser evaluate an arithmetic expression?
What is an expression?
What is an expression?
What is a term?
What is a term?
What is a factor?
What is a factor?
What are the 2 facts recognized by modern software?
What are the 2 facts recognized by modern software?
How many interfaces can an interface extend?
How many interfaces can an interface extend?
Can an interface be generic?
Can an interface be generic?
What contains a description of WHAT the software does?
What contains a description of WHAT the software does?
What contains a description of HOW the software does it?
What contains a description of HOW the software does it?
What can interfaces define?
What can interfaces define?
What can't interfaces define?
What can't interfaces define?
All instance methods in an interface are automatically public abstract?
All instance methods in an interface are automatically public abstract?
Is it usual for an interface to define variables?
Is it usual for an interface to define variables?
Are constructors instance methods?
Are constructors instance methods?
What does Kernel Interface define?
What does Kernel Interface define?
What does Enhanced Interface define?
What does Enhanced Interface define?
Kernel methods should be a __________ set of __________ that is __________.
Kernel methods should be a __________ set of __________ that is __________.
What is a functionally complete set of kernel methods powerful enough to do?
What is a functionally complete set of kernel methods powerful enough to do?
What is circularity in interfaces?
What is circularity in interfaces?
A Java interface defines a ______ ____ along with its set of ________ ________.
A Java interface defines a ______ ____ along with its set of ________ ________.
An interface type may be used in Java even if there is no implementation of it in scope?
An interface type may be used in Java even if there is no implementation of it in scope?
Interfaces are ______- constructs.
Interfaces are ______- constructs.
After a Java program compiles, object types are kept at ______- constructs.
After a Java program compiles, object types are kept at ______- constructs.
What is a declared (static) type?
What is a declared (static) type?
What is an object (dynamic) type?
What is an object (dynamic) type?
The declared type of a variable may be an interface type?
The declared type of a variable may be an interface type?
The object type can be an interface type?
The object type can be an interface type?
What happens if the declared type is an interface type?
What happens if the declared type is an interface type?
What happens to declared types once a Java program compiles?
What happens to declared types once a Java program compiles?
Study Notes
Abstract Classes and Interfaces
- An abstract class allows partial implementation, containing some defined methods while leaving others unimplemented.
- Factoring out common code into an abstract class enables reuse across implementations of a particular interface, such as NaturalNumberKernel.
- Abstract classes cannot be instantiated, meaning objects cannot be created directly from them.
Testing and Control
- Unit Under Testing (UUT) refers to the specific component or code being tested.
- To manage changes effectively, re-route UUT constructor calls to a single method, allowing modifications in one location instead of multiple.
Class Types and Variables
- A class ending with "L" is known as a kernel class, serving as a direct representation of a new type using existing Java library components.
- Instance variables are unique to each instance of a class and maintain their names across instances.
Kernel Implementation Criteria
- Effective kernel implementations should be easy to understand and more efficient.
Data Structures
- A Sequence3 is represented using two stacks: left and right, where the sequence can be viewed as
rev(left) + right
. - Client view focuses on the mathematical models and method contracts, while the implementer view deals with data representation and algorithms.
State Spaces
- Abstract state space consists of all potential mathematical model values from the client's perspective.
- Concrete state space represents all possible values within the data representation.
Functions and Invariants
- The abstraction function defines how to interpret a concrete value satisfying the representation invariant into an abstract value.
- Representation invariant describes valid configurations of instance variable values.
Hashing and Linked Lists
- Hashing allows for quick identification of items in data structures and ensures items are contained within the structure.
- Linked lists do not require nodes to have contiguous memory addresses and accessing nodes is done sequentially in linear time, not constant time.
Heaps and Trees
- Heaps are binary trees with constraints on their shape and organization, and they may not completely sort elements when built.
- A binary search tree (BST) requires that each left node is less than the root and each right node is greater than the root.
Sorting Machine
- A sorting machine adds elements to a collection and removes them in sorted order, described mathematically by a 3-tuple containing insertion mode, ordering, and contents.
Smart Nodes
- Smart nodes do not improve performance in linked list manipulations or setup times but can help simplify certain removal cases from linked list methods.
Compiler Components
- A typical compiler consists of three parts: Tokenizer, Parser, and Code Generator, abbreviated as TPC.
- The Abstract Syntax Tree (AST) represents program structure abstractly, omitting characters from the concrete program.
Parsing and Grammars
- Context-Free Grammar (CFG) defines formation rules for language strings and is implemented using a recursive-descent parser.
- Terminal symbols mark endpoints of productions, while non-terminal symbols appear only on the left side of productions.
Tokenization and Parsing
- A tokenizer splits source code into meaningful units and removes whitespace, while parsing converts string input to its derivation tree or AST.
Interface Characteristics
- An interface can extend one or more interfaces and must define an abstract type with instance methods.
- Interfaces cannot define constructors or instance variables but can declare static final variables.
Type and Object Relations
- Declared types can be interface types, but object types must be class types that implement the declared interface.
- After compilation, declared types are absent in the JVM, retaining only object types for runtime.
Miscellaneous
- Refactoring restructures code while preserving functionality for better readability and maintainability.
- Circularity occurs when interfaces define mutual dependencies, indicating a structural design flaw.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Prepare for your CSE 2231 final exam with these flashcards focusing on key concepts such as abstract classes and code factoring. Each card offers concise definitions to enhance your understanding of important programming principles and terminology. Master the material effectively and boost your confidence!