![]() The directory dir contains two sub-directories subdir1 and subdir2. The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: ![]() Suppose we represent our file system by a string in the following manner: You should be as efficient with time and space as possible. i is guaranteed to be smaller than or equal to N. Get_last(i): gets the ith last element from the log. Record(order_id): adds the order_id to the log Implement a data structure to accomplish this, with the following API: You run an e-commerce website and want to record the last N order ids in a log. Given a stream of elements too large to store in memory, pick a random element from the stream with uniform probability. Hint: The basic equation of a circle is x^2 y^2 = r^2. Estimate \pi to 3 decimal places using a Monte Carlo method. THE PROBLEM
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |