An AVL tree is a self-balancing binary search tree, where-by the height of a node’s children differ by at most one. In the event that this property is violated a re-balancing process takes place.
This past week discussion around solving anagrams was brought up - I thought it would be interesting to devise a couple of methods for computational achieving such a task. Providing an anagram string and a dictionary file, I wished to be returned all possible matching words from the dictionary.
array_column function has been a welcome addition to the PHP language, allowing us to remove the need for common-place
array_map invocations that just pluck specific values from arrays.
However, I just found out that you can provide a third argument that allows you to define what the returning arrays keys will be.
This combined with
null for the value argument allows you to easily re-index an array based on a key value whilst maintaining the original arrays values and ordering.
In the 100th episode of Three Devs and a Maybe I decided to generate some stats relating to the previous 99 episodes and formed a small quiz out of these findings. All information relating to each podcast is stored in separate Markdown files within YAML front-matter, which makes it easy to pull out and process. I thought it would be interesting to go over the code I used to achieve this.