摘要:
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following req... 阅读全文
摘要:
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the ... 阅读全文
摘要:
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio... 阅读全文
摘要:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.top-down还是o(nlgn)。自己没有细想,不过查了一下,发现还是有o(n)... 阅读全文