Book read: Data Structures and Algorithms using Java

Recently I had a reminder that my algorithmic knowledge is less than stellar. This inspired me to read some books on the subject. I started with Data Structures and Algorithms using Java (note the “using” word, there’s a very similar book called Data Structures and Algorithms in Java). I thought a post would be nice on it, so here it comes.

Basically it’s a university textbook, so it’s very accessible but has some quirks. I’d note that referring to all practices, results and evolution of the software industry (the part of it which isn’t considered as academia) as good penmanship is a little bit pejorative at least. One more thing and I’ll finish my rant. I don’t like religious wars on where to put your starting braces, when I program in C# I consistently put them on a new line. When I use Java or Objective-C I always put them on the end of the line. But I didn’t even possibly think of putting them on a new line, then continue writing code on that very same line. So if you easily get frustrated by this:

public class MyJavaClassWithHorribleConventions

{  private int myField; //look at how I’m commenting


you’ll have a very rough time reading this book.

As I promised, this is the end of the rant, let’s look at the good things. The book is very accessible, with just enough theory to be able to read it after a long workday. There is very little mathematics involved, only basic algebra. There are lots of pictures showing each step of an algorithm, so you’ll get a pretty clear visual representation of what’s going on. Also, code samples as the title shows are in Java, (of course, on this level of complexity, they could be in almost any reasonable language) so it’s readable for a C# developer as well.

The books covers the big O notation, algorithm time and space analysis, basic data structures, such as arrays, linked lists, stacks, queues. A whole chapter is dedicated to hashing and hashed data structures. There is a chapter on recursion and on different types of trees (binary, AVL, red-black). There’s some coverage on sorting algorithms, but I’d expected more on the subject. The last chapter deals with graphs, and that’s all.

As a summary, as someone who doesn’t have a formal CS background and didn’t really looked up the subject of data structures, I found this book very useful. Although I’m sure I won’t stop here, but it provides a good foundation studying algorithms.


Implement a Custom Authentication Scheme

Now this one is short will be short and will have nothing to do with the title. I’ve found four enumerations in the System.Security.Authentication namespace. The most important of these is the SslProtocols enumeration. It has five possible values. You should know that the Ssl values (Ssl2 and Ssl3) are provided only for backward-compatibility and they are all superseded by the Tsl protocol. The fifth value is None, and it speaks for itself. Here’s a repeat for a better layout of this blog:

  • SSlProtocols enumeration:
    • Default (Ssl3 or Tsl will be used)
    • None
    • SSl2
    • Ssl3
    • Tsl

I forgot to mention that this enumeration controls which SSL protocol should be used for a given SslStream. Just in case if someone didn’t figure it out.
Continue reading