Implementation of Binary Search Trees Via Smart Pointers
Journal Title: International Journal of Advanced Computer Science & Applications - Year 2015, Vol 6, Issue 3
Abstract
Study of binary trees has prominent place in the training course of DSA (Data Structures and Algorithms). Their implementation in C++ however is traditionally difficult for students. To a large extent these difficulties are due not so much to the complexity of algorithms as to language complexity in terms of memory management by raw pointers – the programmer must consider too many details to ensure a reliable, efficient and secure implementation. Evolution of C++ regarded to automated resource management, as well as experience in implementation of linear lists by means of C++ 11/14 lead to an attempt to implement binary search trees (BST) via smart pointers as well. In the present paper, the authors share experience in this direction. Some conclusions about pedagogical aspects and effectiveness of the new classes, compared to traditional library containers and implementation with built-in pointers, are made.
Authors and Affiliations
Ivaylo Donchev, Emilia Todorova
Day-ahead Base, Intermediate, and Peak Load Forecasting using K-Means and Artificial Neural Networks
Industries depend heavily on the capacity and availability of electric power. A typical load curve has three parts, namely, base, intermediate, and peak load. Predicting the three (3) system loads accurately in a power s...
Data Mining Models Comparison for Diabetes Prediction
From the past few years, data mining got a lot of attention for extracting information from large datasets to find patterns and to establish relationships to solve problems. Well known data mining algorithms include clas...
GIS Utilization for Delivering a Time Condition Products
As population is increasing rapidly all over the world, the need for delivering products is being more difficult especially for conditional products (products with life time). Many Customers require conditional products...
Balancing a Sphere in a Linear Oscillatory Movement through Fuzzy Control
The following paper describes an intelligent control problem, which depends on the balance of a metallic sphere on a beam, that oscillates in only one point, localized in the middle of the beam, using it for the ba...
SAFFRON: A Semi-Automated Framework for Software Requirements Prioritization
Due to dynamic nature of current software development methods, changes in requirements are embraced and given proper consideration. However, this triggers the rank reversal problem which involves re-prioritizing requirem...