5

Wtf is a binary tree

Comments
  • 13
    A tree where each node has no more than two branches.
  • 0
    @olback and why would you need to invert them lmfao
  • 9
    @OmerFlame depending on purpose you first build it, then you can rebalance or invert or a lot of other operations to change it.

    Its used for fast lookup and depending on which root node you have you get different characteristics on the lookup.

    But before building it you might not know which node is best for performance.
  • 1
    @Voxera huh. Interesting.

    For normal development this is completely unrelated, right?
  • 3
    It's just that. Just a name to describe a hierarchy in which each branch only has two edges.

    The last (and probably only) place I heard about it was in the context of machine learning and decision trees. When evaluating a node, the only outcome was yes/no, a/b.
  • 4
    @OmerFlame depends on what you mean by "normal development". Some sorting algorithms work with binary trees
  • 2
    @Creep oh, so it’s mostly related to data science.
  • 2
    @OmerFlame That was just an example. There are probably more kinds of algorithms that use binary trees
  • 1
    @Creep so its for engineering decision-making processes for computers, I think that would be a much more apt description than just “data science”
  • 3
    @OmerFlame I mean I guess one could say it's a fancy description for a pretty basic concept. You might even implement it yourself some day while solving a problem without knowing that it's a binary tree
  • 1
    @Creep I can actually see that, damn
  • 2
    It is a data structure. It is not data science specific - its algorithems are very usefull in specific use cases. Game theory, indexed data search, and math expression eveluation for example. You can regard it as a very specific type of a directed asyclic graph (DAG) with a max outgoing edges of 2 per node, and exactly 1 incomimg edge per node.

    Algo/CS oriented developers need to know how it works, and what it is good for. Most mundane dev work does not care - the common libraries you use everyday, use it when appropriate. think about the python sort function, and c# and java generics compare interfaces.
  • 3
    A binary tree is a tree that is exclusively masculine or feminine. 🥁
  • 2
    @Mandrake what if I'm a queer tree
  • 1
  • 2
    It is something we know but have no idea where and how it is implemented
  • 1
    Tree data structure of traversal arity 2.

    They're typically data structures that are optimized and sorted so you can traverse it to a given point in O(n) time.

    Example: autocomplete indices are routinely bitwise tries. They're an example of an implicit binary tree; their absolute node arity can be greater than 2, but the traversal direction is always inferred from a Boolean result and so is algorithmically arity 2.
  • 1
    @alexbrooklyn you're probably a bush then
  • 0
    No, WTF is not a binary tree
  • 0
    @OmerFlame in most cases yes, you do mot need it.

    I can remember one single time I had to deal with binary tree and that was when formatting a file to be sent to a handheld scanner that required a balanced binary tree as file structure.

    That was about 23 years ago or so.

    After that it was only been for hobby purposes.

    But in very high performance requiring cases I assume you still might need it, and as one type of proof of some deeper knowledge or test to see if you have read some level of university courses sure.

    Not something I think any average programmer will need or be expected to write today.

    It always help to have an overall grasp of it though, if only to better understand documents using it in descriptions.
  • 1
    Imagine asking like this on Stackoverflow
  • 0
    I rather ask in devrant rather in SO. Asking in SO is like a teacher constantly look at your back while you take the test.

    Devrant people are friendly despite the name.
  • 1
    @theabbie SO is good if you have a well defined question and a bit if luck on who are first to see it.

    And there is a drive going on from the company behind it to try to ease the entry a bit since there have been a bit to much hard core moderators.

    But I have quite a few questions there I have received good answers on and a lot of answers with a healthy number of up votes.

    But so far here there are a more manageable amount of questions and generally nicer tone :)
  • 0
    @Voxera Googleable Questions are not welcomed for sure, Or, You will have to specify what part of it you didn't understand
  • 1
    @theabbie thats one thing yes :) SO prefers “new” or well explained questions since its goal is to be a encyclopedia of questions to.

    To many similar or low quality questions or answers will detract from that.

    But I wish there could be a little more assistance to new users with help to find good questions and add links to those.

    That would help funnel others to the right place.

    But its also one of the largest such sites and that leaves lots of room for self appointed governors.
  • 0
    @Voxera Most people are bad at googling, Almost everything has been asked
  • 1
    It's a tree that contains only 1s and 0s 😆
  • 1
    @theabbie but only most. :)
  • 0
    The ones that grow after you plant a randomizer seed
Add Comment