CS3100 notes


home

Here you will find some teaching notes from time to time.

[00/00] The object scope variables will be always private unless you can make valid argument why they should be something else.

The methods (except main) will be all public (non static) unless you can make valid argument why they should be something else.

The main will be static.

The variables inside method are never accessible outside of the method. We do not say private or public. We say, they are local vars and not accessible by anyone except the method. If you want to understand it better, read the book, we may discuss it at some point, or look at the java program on that page which talks about scope of vars.


[00/00] The book has definition of Big O() performance measure on page 81. It is incorrect.

The correct definition is as follows.

f(n) is O(g(n)) if there is constant c in R+, and there is constant n0 in N, such that for all n >= n0, f(n) <= c*g(n).

[00/00] ADT Specification and ADT Implementation are two different things.

Lets consider example Stack.

ADT Specification of stack consists of specifications of the methods that describe the interface.

ADT Implementation of stack consists of one or more classes implementing the data and implementing the interface methods and possibly implementation of some assist methods that are not part of the interface.



[02/20] Note that the parent and child pointers inside the LL methods have nothing to to do with parent and child classes when I discussed inheritance.


In inheritance the parent/base/superclass means the class from which we are inheriting data and methods. The child/subclass means the class that inheriting data and methods from the parent.


In the LL methods, I needed two pointers that are following each other. They could be called currentp and followerp. Or currentp and successorp. I called the two pointer parp and childp.

If not clear ask.

[03/07] Every method X using recursion, we will implement using two methods named XRec1(...) and XRec2(...). The XRec1(...) just does some preparation and then passes the work to XRec2(...). It is the XRec2(...) that calls itself many times, each time with a smaller amount of data.

In terms of ADT, the XRec1(...) is part of the ADT interface, XRec2(...) is not part of the interface. The XRec2(...) should never be called directly except maybe during testing.

[03/22] Although the algorithms that I gave you in the beginning of the course were so detailed that they were essentially exactly programs, as the course progresses, you need to be able to understand the algorithm and fill in the details.




















Copyright

All information on this website is copyrighted by Robert R. Silverman, 2002, ... current date. No part of this system or information presented here can be reproduced using any means, such as: book print, physical, electronic, chemical, biological, mathematical, telepathic, or other not yet discovered means without the explicit permission by Dr. Robert R. Silverman, CSU Stanislaus, rsilverman@csustan.edu An explicit permission is given to all my students to copy this material as needed for educational noncommercial purpose.