Texas Instruments Interview Question

Implement graph from scratch in any language