Category: data structure
The Dictionary is an important data-structure and is a very handy tool to store a collection of key-value pairs. The Dictionary object can be created easily using Scripting language …
Disjoint Sets is one of the most powerful and yet simple data structure. The idea of Disjoint Sets can be perfectly applied in finding the minimal spanning tree. The …
The Iterator is an interface for external iterators or objects that can be iterated themselves internally. In PHP, it is defined as follows. Iterator extends Traversable { /* Methods …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/137/B It took me several attempts to get it right for this problem although it is not difficult. The problem is find out how …
May 20, 2012
algorithms, beginner, code, codeforces, data structure, implementation, programming languages, python, string, technical
The problem is from codeforces: http://www.codeforces.com/problemset/problem/158/C Using a stack will help solve this problem. Luckly, python supports stack structure by using list. The append() and pop() are used to …