I wrote these short methods to remove a node from an unbalanced BST. Is it "bad style"?

This page summarizes the projects mentioned and recommended in the original post on /r/cpp_questions

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • linked-list-good-taste

    Linus Torvalds' linked list argument for good taste, explained

  • 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).

  • 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.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts