Trees And Heaps For Xmas - A Programmer At Xmas
Written by Mike James   
Tuesday, 24 December 2024

Christmas is a time for tradition. Finding the Christmas lights in the dark recesses of a cupboard and hanging much-loved baubles on the Christmas Tree. Running this xkcd cartoon has become a part of  I Programmer Christmas. Merry Christmas to all our readers.

'Tis that time of year when it is OK to use the word 'tis. Programmers are a funny lot, keen and eager to program, but they too are forced to stand away from the keyboard and stop coding. Why exactly? Well there are festive treats to open and consume and Xmas is a CS problem in its own right.

And more realistically, the family would disown them if they coded through the 25th. Set free from the lexicographic abstraction, who could blame a programmer's mind from wondering about the essentially programming nature of the holiday:

 

Tree

More cartoon fun at xkcd a webcomic of romance,sarcasm, math, and language

Then there is the question of how exactly do the elves solve the travelling santa problem, or TSP? Presumably they have a cloud computer running for most of the year or maybe santa has cracked quantum computing. If so I would like it on my xmas list.

The TSP is just one of the many difficult, if not NP Hard, problems that are embedded in the core of xmas.

The present assignment problem is closely related to the knapsack problem and then there is the Christmas cake cutting problem...

When you start looking CS is everywhere in xmas.

Of course this is just part of the story - because CS is just everywhere and not just at xmas. If Billy had been better trained in programming and computer science he would at least know the cost of removing the root present. How many other tragedies could be avoided if we just insisted that algorithms were a part of life and a part of the school curriculum.

And when it's all over we can start the GC algorithm and hope it defrags the house in O(1).

Happy programming year.

cartoonxmas

 

More Information

Tree

Related Articles

Donald Knuth's Xmas Lecture Is Back

Xmas Tech Videos

How Robots Celebrate Christmas 

Christmas Is NP Hard

Robotic Present Delivery       

New Year's Eve With Nao

Nao Plays Jingle Bells

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Google Explains Add Me
31/01/2025

Add Me is an AI-based feature for Google's Pixel 9 phones that lets you add missing individuals into group photos. Google has now explained how this "magic" feature was developed.



European Robotics Hackathon 2025 Open For Entries
17/01/2025

ENRICH 2025, the European Robotics Hackathon, is open now for team entries. To be held at the Zwentendorf Nuclear Power Plant in Austria, the aim is to develop robots that can carry out tasks in a nuc [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1871962439> 

<ASIN:1871962722>

Last Updated ( Tuesday, 24 December 2024 )