CS241: Spring 2017 -- Expression evaluation - postfix to infix; and making a queue of 2 stacks
- Quiz feedback. For Thurs quiz: pseudo-code for converting infix to postfix.
- List vocabulary
- head - first thing in the list (or, the front of the list)
- tail - last thing in the list (or the end of the list)
- A few words about the basics of classes and superclasses
- All classes in Java extend
Object
!! So... when the compiler sees
class Foo {...
it changes it to
class Foo extends Object {...
for your convenience (just as it adds .toString()
when you sout an instance of some class... convenience, it's done for your convenience)
- You can assign instances of subclasses to variables of their superclass(es)
- So... this is legal:
Object something = new Foo();
- I.e. you can store *any* object in a variable of type Object; but! Having done so, you can only send that something messages that Object defines.
- Groups: implementing a queue with 2 stacks
- postfix to infix
- Finishing GreatBigInt, and then using it to compute Fibonacci(100). The process of building software.
- Representation -- ArrayList<Integer>, with one digit in each, least significant first
- Initialization -- addDigit(int)
- Display
- GreatBigInt add(GreatBigInt that) -- returns the sum of this and that
- this and that have the same number of digits
- this has more digits than that
- that has more digits than this
- carry
- designing your code to handle all the special cases... but what are they??