Suffix Array is an interesting data structure. Querying time, O(|P|*log(|T|)), for pattern matching, Longest Common Prefix, it has got tons of applications. Recently, I came upon this problem, Mountain Holidays, in CodeChef July Challenge 2013, which required an application of suffix array. Now I... (more) I had told Jessica Su that I would post about what I learnt in Fenwick tree (aka Binary Indexed Tree or BIT in short) sometime back. This elegant and powerful data structure is one of my favorite and is needed in many programming contest problems.
Here is one of the best tutorial on the topic th... (more)