Showing posts with label Patterns. Show all posts
Showing posts with label Patterns. Show all posts

Monday, April 29, 2013

"Patterns in Java : A Catalog of Reusable Design Patterns Illustrated" by Mark Grand

Pranaam! Working on "Patterns in Java : A Catalog of Reusable Design Patterns Illustrated" by Mark Grand this week. This is a "Volume 1" edition, I've got and is an old print. The notations used previous to UML 2.0, but I liked the explanation. Revising this under a tight timeline, since this needs to go back to shelf. Writing a running log here:

  • Overview of UML
    • This covers notations for 3 basic UML diagrams viz. Class Diagrams, Collaboration Diagrams and StateChart Diagrams
  • Software Lifecycle

Sunday, April 28, 2013

"Data Structures and the Java Collections Framework, Third Edition" by William J Collins

"Data Structures and the Java Collections Framework, Third Edition" by William J Collins[2011 print]

In tune with multi-threading, I'm beginning a new thread on Java Collections, in an attempt to solidify core Java essential concepts.

Monday, January 21, 2013

"Algorithms in a nutshell" - Part 1



I'm revisiting materials on Algorithms and finding below book very useful.
The first 2 chapters are very impressive in setting a base, actively working through the rest of book.

A "problem" can be defined as collection of data processed by the program to create a solution for the data. Though its difficult to establish a standard problem
definition for real world scenarios, its can help if data inputs & data properties (encoding) are well understood.

When choosing an algorithm using abstraction on rate of growth, ex. evaluating a value in an set of number, the estimated average evaluations needed can be formulated
mathematically. Typically for high growth rate problems, the constants in formulation can be ignored. But care needs to be taken for scenarios like small growth or small number set,
as algorithm application changes. As a principle, the choice for algorithm depends on type of problem and distribution of elements in problem. There is no optimal algorithm for
problem of a given nature.
Methodology for choosing an algorithm:

Perform 3 case analysis viz. worst-case, average-case and best-case

The performance families in terms of decreasing efficiency are viz.
constant O(n)
logarithmic
sublinear
linear = eg. addition
nlog(n)
quadratic eg. multiplication
exponential

The author did lose me during the mathematical analysis and formulation of Big O notations for each member of performance family. Its a to do to check the reference section and build skills sets in those.
The graphical patterns of performance family definitely gives a visual clue as what type of operation is the algorithm using. very nice.

A side note about distribution:
binary tree distribution: works well during search when items are equally or roughly equally distributed(red-black tree) in a binary tree
ordered distribution : n/2 items need be compared on an average to search for an item