mainec,
@mainec@fromm.social avatar

Does anyone in my English speaking bubble have convincing examples what to use ordered trees for - and for best to explain them? @sylvia - a lovely music/math/computer science teacher that ages ago was one of the children I went to school with - is looking for ways to introduce the concept to her students.

mainec,
@mainec@fromm.social avatar

@sylvia https://shop.bubblesort.io/collections/zines/products/bubble-sort-and-other-sorts-zine ... Sorting, but no trees - though I love these magazines.

mainec,
@mainec@fromm.social avatar

@sylvia maybe @b0rk has a hint?

b0rk,
@b0rk@jvns.ca avatar

@mainec @sylvia do you mean like binary search trees? the main time I've run into those IRL is when you have a bunch of IP ranges, and you want to be a ble to quickly look up which IP address

for example:

  1. IIRC maxmind's geoip databases are basically structured as a binary search tree
  2. looking up the ASN for an IP address in this database https://iptoasn.com/

not sure if it's the best example though because you can accomplish basically the same thing with an array + binary search

b0rk,
@b0rk@jvns.ca avatar

@mainec @sylvia I guess another place I'd think of using ordered trees is when parsing a programming language into an AST

b0rk,
@b0rk@jvns.ca avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • ngwrru68w68
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • tacticalgear
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • ethstaker
  • JUstTest
  • GTA5RPClips
  • modclub
  • tester
  • Leos
  • osvaldo12
  • cisconetworking
  • everett
  • cubers
  • normalnudes
  • anitta
  • megavids
  • provamag3
  • lostlight
  • All magazines