As a software engineer algorithms are the base of our work and one of the task of our job is sometimes resolve a specific problem and to be able to do it you need to know what’s the best way to get there. This is what make us, software engineer, the best tool for this job. I use to ask to my self when I was in college why should I know how to implement a “Selecting Sort” or “Insert Sort” since I could use a library that could give me everything that I need? Now looking back I can tell you one thing you may think that you are resolving a problem but you are actually skipping the problem.
I will give an example, Arrays, structure that allow us to work with multiple values of the same type but there is one more thing that we need to remember, we want not only store values but also to access each individual value, so let’s review it:
To declare the array, you need to specify a name and the type of data it will contain. To create it, you need to specify its length (the number of values). For example, the “long form” code shown at right makes an array of N numbers of type double, all initialized to 0.0. The first statement is the array declaration. It is just like a declaration of a variable of the corresponding primitive type except for the square brackets following the type name, which specify that we are declaring an array. The keyword new in the second statement is a Java directive to create the array. The reason that we need to explicitly create arrays at run time is that the Java compiler cannot know how much space to reserve for the array at compile time (as it can for primitive-type values). For economy in code, we often take advantage of Java’s default array initialization convention and combine all three steps into a single statement and there’s a few thing that sometimes we don’t think about.
- What should we do if the length declared in the initialization is not enough?
- What’s the best size?
- How we increment the size?
See this is the kind of the detail that I want to share with you all.
- Stack and Queues
- Analysis of Algorithms
- Elementary Sorts
- Priority Queues
- Symbol Tables
- Binary Search Trees
- Balanced Search Trees
- Hash Tables
- Undirected Graphs
- Directed Graphs
- Minimum Spanning Trees
- Shortest Paths
- String Sorts
- Substring Search
- Regular Expressions
- Data Compression
To make it happen I’m going to use some of the books listed below:
- Statistical Mechanics: Algorithms and Computations by Werner Krauth
- The Art of Computer Programming: Fundamental Algorithms Volume. 1: Fundamental Algorithms v. 17 by Donald E. Knuth
- Algorithms (Irwin Computer Science) – 1 Oct 2006 by Sanjoy Dasgupta, Christos H. Papadimitriou, Umesh Vazirani
- The Algorithm Design Manual – 14 Nov 2011 by Steven S Skiena
- Introduction to Algorithms – 20 Aug 2009
- Essential Algorithms: A Practical Approach to Computer Algorithms – 5 Sep 2013
- Algorithms – 28 Apr 2011 by Robert Sedgewick, Kevin Wayne