Deisgn Inmemory File System

ls:

  1. initialize t, and iterate it to the last point. (by spliting “path” using “/”)
  2. Stop at either end level dir or file name, if it is file name, just return the file name. Otherwise if it is a dir, get its sub-dirs and add them into output;

  3. sort the ouput list and return.

Mkdir:

  1. iterate pointer to its end
  2. if there is no esxisting path, add it