Implement an in-memory key–value store that supports create, read, update, and delete operations. Expose APIs such as put(key, value), get(key), update(key, value), delete(key), and exists(key). Choose and justify an underlying data structure (e.g., a B-tree or another ordered index) and analyze time and space complexity. Discuss edge cases like overwriting existing keys and missing keys.