Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I'm in a data structures course as an undergraduate over the summer. For practice, I made an unbalanced binary search tree class in C++ with search, insertion, removal. We were given pseudo-code for removal, but I noticed a lot of repeated logic could be used if I traversed the tree with a pointer to pointer to Node, and that it didn't need recursion. I saw the same logic as what's explained by "Linus Torvalds' linked list argument for good taste, explained", and I'm pretty familiar with it by now. My tree traversal about 40 lines of actual code, but about 70 lines with comments. However, I showed this to a classmate, and they couldn't follow it at all, and said that it seemed complicated. I'm also concerned because this logic isn't portable to any language that doesn't allow pointers to pointers, i.e. not in Java, Python, etc., only C, C++, and maybe Rust (I don't know if this is portable there).