📄 Abstract
Deciding whether a single character belongs to a small, fixed category is one of the most frequently repeated operations in text processing, yet the implementation choice behind it is rarely examined closely. Vowel identification is a convenient, self-contained example of this larger problem: a program must decide, for every character it reads, whether that character belongs to the set {a, e, i, o, u}. This paper studies two ways of performing that check. The first, character_vowel_check(), uses a sequential chain of if/elif comparisons. The second uses set membership testing, in which the character is looked up in a hash-based set through Python's `in` operator. Both are analysed theoretically through Big-O time and space complexity and then empirically, through direct benchmarking across string lengths ranging from one thousand to one million characters. A second experiment extends the comparison beyond the fixed five-vowel case by scaling the size of the target category itself, from five members up to three hundred and twenty, to test whether the two approaches diverge further as the category grows. The results show that although both implementations share the same asymptotic order for this task, the constant-factor difference between them is large enough to matter in practice, and it grows sharply once the category is no longer as small as the vowel set.
🏷️ Keywords
📚 How to Cite:
Cadet D Nivaashan , Cadet E Egan , EVALUATION OF THE character_vowel_check() ALGORITHM VERSUS SET MEMBERSHIP TESTING FOR VOWEL IDENTIFICATION. AN EXAMINATION OF TIME COMPLEXITY AND PRACTICAL RUNTIME BEHAVIOUR OF BOTH APPROACHES - A CASE STUDY , Volume 12 , Issue 8, August 2026, EPRA International Journal of Multidisciplinary Research (IJMR) , Pages: 493 - 497 ,