What is the best thing you may possible do when having a eight hours train trip? Writing a blog post of course! That’s actually an interesting story by itself: Where I was and why it take that long to come back home! Anyway! Let’s say you’ve an array of integers, as usual from index 0 to… Continue reading Segment tree

# Category: Algorithms

## Solution space.

Certain problems required us to try all the possible solutions to find the one that best fit the given constraint, a very popular brute force way is to perform a complete search of the solution space by iterating over and over the data and changing each time the input variables. If the problem require to… Continue reading Solution space.

## Suffix trees.

An entire post covering both the theoretical part and the implementation is going to take too long, for this reason I’m splitting the material in two parts: A post with some theory introduction, and one post which will be focused on implementation details. The algorithm I would like to show you is the Ukkonen method for… Continue reading Suffix trees.

## String searching algorithms comparison.

With nature OPHELIA sick had. heel him my MARCELLUS the A with my in comes not sweet if! A means may too; that quantity prepare did! have would not thou But do; thirty fortune, lament And are A of and havior There and. QUEEN am What worse kind. at might at wears that as That… Continue reading String searching algorithms comparison.

## Jewels and Endomondo, reviews.

I spent a reasonable amount of time on Jewels of Stringology and I feel ready to share with you what do I think about the book, I’m also ready to share with you how do I like endomondo since I’ve bee using it in the past two weeks, but let’s start with Jewels! Jewels. I like… Continue reading Jewels and Endomondo, reviews.

## Subsequences and Fenwick tree’s

Let’s say that we have a sequence A of 1<=n<=10^5 elements, and that this sequence may or may not be ordered but all the numbers {1…n} are present exactly once. And now given 1<=k<=10, you’re asked to find all the increasing sub-sequences of A with exactly k+1 elements. This is a problem I get from a competitive programming… Continue reading Subsequences and Fenwick tree’s

## Labyrinths (not really)

The labyrinthitis is a serious problem* which effect many people, is particularly common in people between the age of 18 to 99 owning a driving license and a car, you may encounter on the road on a daily basis people with this illness! Drive safe out there! If you are confused, well I understand!I’m trying to… Continue reading Labyrinths (not really)

## Longest subsequence with K

Maybe some of you may wonder why lately I wasn’t posting any algorithm, or maybe not. But, I feel the compelling need to explain You the reason behind this behavior! Well, I’m working on my combinatorics book, which just happen to be a very demanding one, and it takes all my free time and free energies.… Continue reading Longest subsequence with K

## Magic paths!

Hi! There are lot of problems related with finding the shortes or the longest path in graph, most of them using forms of DFS,BFS or in case of weighted graph using the Dijkstra algorithm, Bellman-Ford or one of the many other. Let’s see one of those problem: Given a weighted –no negative weights– connected graph… Continue reading Magic paths!

## Counting bits! A lot of bits!

Hello! Tomorrow is an important day for me and I promised to myself that I will just chill all the day before, you know in order to keep the mind clean and fresh.. But.. I found this interesting problem and you know what, let’s work it out 🙂 The problem is: You’re given two numbers… Continue reading Counting bits! A lot of bits!