Paper Type |
Contributed Paper |
Title |
Ranking and Unranking of Well-formed Parenthesis String: A Unified Approach |
Author |
Ro-yu Wu,Jou-Ming Chang, An-Hang Chen and Chun-Liang Liu |
Email |
spade@mail.ntcb.edu.tw |
Abstract: A string s of length 2n is called a well-formed parenthesis string (w.f.p. string for short), if it consists of n left parentheses than left parentheses. W.f.p. strings are represented in the literature by different types of integer sequences including P-, X-, and T-sequences. In this paper, we introduce a new class of sequences, called L-sequences, which originates from the so-called RD-sequences for representing k-ary trees and their generalization, called non-regular trees. This paper deals with the ranking and unranking of w.f.p. strings in lexicographic order under these representations. We give linear-time transformations between L-sequences and other type of sequences, and design linear time ranking and unranking algorithms for all these sequence types. |
|
Start & End Page |
648 - 659 |
Received Date |
2011-06-20 |
Revised Date |
|
Accepted Date |
2012-04-27 |
Full Text |
Download |
Keyword |
ranking algorithms, unranking algorithms, well-formed parenthesis strings, lexicographic order |
Volume |
Vol.39 No.4 (OCTOBER 2012) |
DOI |
|
Citation |
Wu R., Chang J., Chen A. and Liu C., Ranking and Unranking of Well-formed Parenthesis String: A Unified Approach, Chiang Mai J. Sci., 2012; 39(4): 648-659. |
SDGs |
|
View:557 Download:236 |