Answer the question
In order to leave comments, you need to log in
Who uses binary trees and other data structures and when?
Hello. There are different data structures (linked lists, trees, hash tables) and different algorithms (quick sort, heap sort, etc.). I am a php + js developer and do not use them, but as I understand it, the language is based on all these data structures and algorithms. For example, the sort function internally uses some sort of algorithm, and arrays are actually hash tables.
Is there any programming language or area where you need to build a binary tree yourself or write a search script in an array, or is this knowledge needed only for academic purposes in order to understand how everything works?
All the programming languages I know already have built-in functions for this. Even "low-level" C has a qsort function.
Thank you.
Answer the question
In order to leave comments, you need to log in
Sometimes you may need something not quite standard. For example, the ability to quickly insert an element at the kth place in the structure and find what lies at the kth position. This is done by an implicit key tree, but in my opinion no language provides a standard structure for this.
Is there any programming language or area where you need to build a binary tree yourself or write a search script in an array, or is this knowledge needed only for academic purposes in order to understand how everything works?
from personal examples: in a game of the Line Tower Defense genre with a field of hexagons, it was necessary to implement pathfinding. Unity's standard mechanism was clearly overkill, so I manually wrote a simple algorithm that used a graph. The second example is literally a week old: having a set of 11 players and knowing what positions they prefer, determine the most probable arrangement on the field so that you can draw in the UI. Implemented through trees. And linked lists are generally used everywhere.
I'm a php+js developer and don't use them
I'm a php+js developer and don't use them
Is there any programming language or area where you need to build a binary tree yourself or write a search script in an array, or is this knowledge needed only for academic purposes in order to understand how everything works?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question