linear-time algorithms for three important problems of this kind. The techniques,
which we have used, seem to be applicable to other ranking problems. On the other
hand, ranking of general restricted permutations has turned out to balance on the
-verge of $\#P$-completeness. All our algorithms run
+verge of $\#{\rm P}$-completeness. All our algorithms run
on the RAM model, which seems to be the only sensible choice for problems of
inherently arithmetic nature. While the unit-cost assumption on arithmetic operations
is not universally accepted, our results imply that the complexity of our algorithm