Efficient enumeration of ordered trees with k leaves

  • Authors:
  • Katsuhisa Yamanaka;Yota Otachi;Shin-Ichi Nakano

  • Affiliations:
  • Graduate School of Information Systems, University of Electro-Communications, 1-5-1 Chofugaoka, Chofu, Tokyo 182-8585, Japan;Graduate School of Information Sciences, Tohoku University, 6-3 Aramaki Aza Aoba, Aoba, Sendai, Miyagi 980-8579, Japan;Department of Computer Science, Gunma University, 1-5-1 Tenjincho, Kiryu, Gunma 376-8515, Japan

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2012

Quantified Score

Hi-index 5.23

Visualization

Abstract

This paper presents a simple algorithm to generate all ordered trees with exactly n vertices including exactly k leaves. The best known algorithm generates such trees in O(n-k) time per tree, whereas our algorithm generates such trees in O(1) time per tree in the worst case.