Code Implementation — CAS Operations
Implement a Concurrent HashMap using Compare-And-Swap (CAS) operations in Python and Java — achieve lock-free reads and fine-grained atomic writes per bucket with retry loops, volatile semantics, and cooperative resizing.