Fortsätt till huvudinnehåll

Inlägg

Visar inlägg från oktober, 2017

Been reading up on Dijkstra's search algorithm

Last weeks have been a bit slow on the algorithm front. Still on it though. I have been solving some Graph challenges on  www.hackerrank.com  and reading several different texts on Dijkstra's search algorithm. It seems like this is an algorithm that is a bit tough to understand and implement in a correct and efficient way. Dijkstra's algorithm can be used on graphs with weighted edges, i.e. different paths have different costs. As long as the weights have positive values Dijkstra's algorithm should work fine. The procedure is quite similar to Breadth First Search, the difference here being that the total edge weight can be less even when more edges are involved. It is therefore necessary to keep track of the current total, and if a shorter path is found, update the total and the parent node (can be used for printing the vertices visited when traveling the shortest distance from vertex v1 to vertex v2). Dijkstra's algorithm is also greedy, in the sense that it visi

Implemented some search algorithms

In order to get a good understanding of the differences between different sorting algorithms I decided to implement some of them myself. The sorting algorithms I implemented were Insertionsort, Heapsort, Quicksort, and Mergesort. These happens to be the same sorting algorithms that are used in the .NET framework. See  https://msdn.microsoft.com/en-us/library/b0zbh7b6(v=vs.110).aspx (Insertionsort, Heapsort and Quicksort used for System.Collections.Generic) and  https://msdn.microsoft.com/en-us/library/bb534966(v=vs.110).aspx (Mergesort used for IEnumerable.OrderBy). I have published them to GitHub for those who wants to take a look, see  https://github.com/Backhage/.NET-Algorithms Now I will continue and implement some Graphs algorithms, starting with Breadth First Search (BFS).

What does those version numbers mean?

Ever wondered what version numbers on software really means? What is the difference between version 1.0.1 and 1.1.2? And what about version 1.9.2 vs version 2.0.5? Well the truth is that there is no law that everyone has to follow, but if you are looking for some good guidelines and a specification that you can apply at your company, I suggest you take a look at  http://semver.org/spec/v2.0.0.html . The Semantic Versioning Specification is a set of rules that describes how to handle the version numbers of your software. It describes when to bump each part of the number, and how to add information about alpha or beta status. Even for components that are only used internally it is a good idea to have a common rule set regarding versioning. Only then does the version number really start to have meaning. So next time you make a breaking change to the public API, be sure to increment the major version!