注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
Implement an in-memory tree key value store.
Definitions:
path is a / separate string describing the node. Example /animals/dogs/german_shepard
Values are all strings
API:
get(path): String -> returns the value of a the node at the given path
set(path, value) -> changes the value of a given node to the new value. Should error out if the path does not currently exist
create(path, value) -> creates a new node and sets it to the given value. Should error out if the node he path of the node that was modified, NOT necessarily the path of the node that was watch’d (unless that happens to be the node modified). If a node is being created old_value is null, if a node is being deleted new_value is null.
Follow up 没写出来,时间不够。题目也没太懂。但是店面过了。
|