Perbandingan Pemanfaatan Algoritma Rekursif dan Iteratif dalam Penyelesaian Struktur Data Pohon - Muhamad Faqih Febriansyah; Gunawan; Muhammad Rhamadani; Tata Sutabri (LPPM Sekolah Tinggi Ilmu Ekonomi - Studi Ekonomi Modern, 2025)
Tree data structures play a crucial role in computer science and are widely used in applications such as databases, compilers, and file systems. Recursive and iterative algorithms are commonly employed to perform operations on trees, especially in traversal processes like preorder, inorder, and postorder. This study aims to compare the utilization of these two approaches in terms of execution time efficiency, memory usage, and code complexity. The methodology involves testing binary tree traversals with varying node sizes using both recursive and iterative implementations in the Python programming language. Experimental results indicate that recursive algorithms tend to be easier to implement and offer more concise code, but they become less efficient with larger datasets due to system stack limitations. In contrast, iterative algorithms demonstrate more stable performance and better memory efficiency at larger scales, albeit with more complex implementation. Based on these findings, the choice of method should be aligned with application context, dataset size, and available system resources.