
build the BST by adding the elements (nodes) one
by one. I define the function search(data). If the
element that should be found is smaller than the
node value I continue to search in the left sub-tree,
else I search in the right sub-tree. I repeat this
iteratively until I find the element. Then I define a
function minValueNode, which is necessary when
deleting the node. The node with minimal value in
the left sub-tree should replace the deleted node, and
other nodes should be rearranged. I define the
function deleteNode for node deletion. I defined the
function insertFirst(data) to build the LL by adding
the nodes one by one. Next, I define the function
delete to delete a node from the LL and reorganize
the links. Then I define the main() function where I
shuffle the elements, build the BST and LL, do the
element search in the BST, and delete the desired
element, do the element search in the LL, and delete
the desired element, and I count the procedure steps.
5 Conclusions
In computer science, it is widely known that a sorted
array is efficient for element search while
complicated for element adding and deleting. On the
other side, LL is very convenient for element adding
and deleting. For a given sample of a data sequence
of 20 elements, I confirmed that BST is performing
binary element search as efficiently as a sorted
array. Also for the same data sample, I
quantitatively confirmed that the BST is the same
efficient in element deletion as LL. This analysis
may be used for the education of undergraduate and
graduate students in computer science.
Declaration of Generative AI and AI-assisted
Technologies in the Writing Process
The author wrote, reviewed, and edited the content
as needed and she has not utilized, artificial
intelligence (AI) tools. The author takes full
responsibility for the content of the publication.
References:
[1] Rubi Dhankhar, Sapna Kamra, Vishal Jangra,
”Tree concept in data structure”, 2014 IJIRT,
Vol. 1, Issue 7, ISSN: 2349-6002.
[2] Sthuti J, Namith C, Shanthanu Nagesh, “Data
Structures and its Applications in C”,
International Research Journal of
Engineering and Technology (IRJET), Vol. 8
Issue 4, Apr 2021
[3] Dimitrios Samoladas; Christos Karras;
Aristeidis Karras; Leonidas
Theodorakopoulos; Spyros Sioutas, “Tree
Data Structures and Efficient Indexing
Techniques for Big Data Management: A
Comprehensive Study”. PCI'22: Proceedings
of the 26th Pan-Hellenic Conference on
Informatics, November 2022, pp. 123–132.
[4] Tutorials Points. Data Structures and
Algorithms (DSA) Tutorial.
https://www.tutorialspoint.com/data_structure
s_algorithms/index.htm (Accessed Date:
March 1, 2024).
[5] Data Structures Tutorial, [Online].
https://www.geeksforgeeks.org/data-
structures/, (Accessed Date: March 1, 20024).
[6] Elshad Karimov, Linked Lists, Chapter in
Data Structures and Algorithms in Swift, pp.
41-54 Apress , 2020.
[7] D. VarshaaA. Keerthana DeviM. Sujithra,
Fundamentals of Data Structures: Stacks,
Queues, Linked Lists, and Graphs, Chapter n
Advanced Applications of Python Data
Structures and Algorithms (pp.1-34), IGI
Global, 2023.
[8] Techie Delight, [Online].
https://www.techiedelight.com/ (Accessed
Date: March 1, 20024).
[9] Travis Gagie. New Ways to Construct Binary
Search Trees, Conference: Algorithms and
Computation, 14th International Symposium,
ISAAC 2003, Kyoto, Japan, December 15-17,
2003.
[10] Roberto De Prisco, Alfredo De Santis, On
binary search trees, Information Processing
Letters, Vol. 45, Issue 5, 2 April 1993, pp.
249-253.
Contribution of Individual Authors to the
Creation of a Scientific Article (Ghostwriting
Policy)
The authors equally contributed in the present
research, at all stages from the formulation of the
problem to the final findings and solution.
Sources of Funding for Research Presented in a
Scientific Article or Scientific Article Itself
No funding was received for conducting this study.
Conflict of Interest
The authors have no conflicts of interest to declare.
Creative Commons Attribution License 4.0
(Attribution 4.0 International, CC BY 4.0)
This article is published under the terms of the
Creative Commons Attribution License 4.0
https://creativecommons.org/licenses/by/4.0/deed.en
_US
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2024.23.12