King election algorithm on ring