Friday, May 29, 2015

Principles of reusable Object-oriented design

1. Program to an interface, not an implementation
Don't declare variables to be instances of particular concrete classes. Instead, commit only to an interface defined by an abstract class.  

2. Favor object composition over class inheritance
This keeps each class encapsulated and focused on one task.

Wednesday, May 20, 2015

Binary Tree Tranversal

Inorder Traversal : LVR
Preorder Traversal: VLR
Postorder Traversal: LRV

   depends on the position of V.
Level Traversal: BFS