# Packing algorithms in C\#: from boxes to booking slots

Canonical source : [Packing algorithms in C\#: from boxes to booking slots](<https://sebastien.rigaux.be/en/tech-watch/links/packing-algorithms-in-c-from-boxes-to-booking-slots>)

This article puts several packing algorithms into practice in C#, from *first fit* and *best fit* to finding restaurant booking slots. It shows why sufficient total capacity does not guarantee a workable placement, and separates checking a solution from searching for a better arrangement.

The booking example uses half-open intervals and a sweep across occupied periods to find free slots. It also accounts for table turnaround time, showing how to incorporate a business constraint without changing the overlap rule.

- Selected on : 2026-11-17

- Resource publication : 2026-11-10

- Entry updated : 2026-11-17T02:44:45+0000

- Format : Article

- Source language : EN

- Credit : Scott Galloway

- Found via : [C\# Digest](<https://csharpdigest.net/>)

Original resource : [Packing algorithms in C\#: from boxes to booking slots](<https://www.mostlylucid.net/blog/packing-algorithms-in-csharp>)

Tags : [C\#](<https://sebastien.rigaux.be/en/tech-watch/tags/c-sharp>)

Available versions : [Français](<https://sebastien.rigaux.be/veille/liens/algorithmes-de-packing-en-c-des-boites-aux-creneaux-de-reservation>) · [English](<https://sebastien.rigaux.be/en/tech-watch/links/packing-algorithms-in-c-from-boxes-to-booking-slots>)

[Back to tech watch](<https://sebastien.rigaux.be/en/tech-watch>)
