11 2018 档案

摘要:Given a blacklist B containing unique integers from [0, N), write a function to return a uniform random integer from [0, N) which is NOT in B. Optimiz 阅读全文
posted @ 2018-11-27 23:23 Grandyang 阅读(3339) 评论(0) 推荐(1) 编辑
摘要:When install the yeoman using the following command: You might have the following error: Try the following commands instead: Now try to type 'yo' to s 阅读全文
posted @ 2018-11-26 02:43 Grandyang 阅读(2277) 评论(0) 推荐(0) 编辑
摘要:Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: "Hello" Output: "hello" 阅读全文
posted @ 2018-11-25 23:09 Grandyang 阅读(1650) 评论(0) 推荐(0) 编辑
摘要:在使用微信官方给的添加自定义菜单的示例代码: 可能会遇到如下的错误: 原因可能是因为想展示的按钮太多了,装不下了,去掉最后两个就好了: 阅读全文
posted @ 2018-11-24 09:07 Grandyang 阅读(5027) 评论(0) 推荐(1) 编辑
摘要:Design your implementation of the linked list. You can choose to use the singly linked list or the doubly linked list. A node in a singly linked list 阅读全文
posted @ 2018-11-23 09:03 Grandyang 阅读(5726) 评论(3) 推荐(0) 编辑
摘要:Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or blocked. The robot cleaner with 4 given APIs can move forward 阅读全文
posted @ 2018-11-20 12:39 Grandyang 阅读(14838) 评论(8) 推荐(2) 编辑
摘要:When the 'fatal error: helper_math.h: No such file or directory' occurs, it means the 'helper_math.h' file is missing. In fact, 'helper_math.h' locate 阅读全文
posted @ 2018-11-19 11:24 Grandyang 阅读(2774) 评论(0) 推荐(0) 编辑
摘要:Given a node from a Circular Linked List which is sorted in ascending order, write a function to insert a value insertVal into the list such that it r 阅读全文
posted @ 2018-11-19 01:15 Grandyang 阅读(6318) 评论(0) 推荐(0) 编辑
摘要:Design a HashMap without using any built-in hash table libraries. Implement the MyHashMap class: MyHashMap() initializes the object with an empty map. 阅读全文
posted @ 2018-11-17 05:43 Grandyang 阅读(7876) 评论(2) 推荐(0) 编辑
摘要:Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a val 阅读全文
posted @ 2018-11-15 23:19 Grandyang 阅读(5234) 评论(0) 推荐(0) 编辑
摘要:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2018-11-12 11:21 Grandyang 阅读(6443) 评论(0) 推荐(0) 编辑
摘要:Design an algorithm to encode an N-ary tree into a binary tree and decode the binary tree to get the original N-ary tree. An N-ary tree is a rooted tr 阅读全文
posted @ 2018-11-12 11:08 Grandyang 阅读(3789) 评论(4) 推荐(0) 编辑
摘要:Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. 阅读全文
posted @ 2018-11-11 09:19 Grandyang 阅读(6231) 评论(0) 推荐(0) 编辑
摘要:Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, 阅读全文
posted @ 2018-11-10 00:50 Grandyang 阅读(3588) 评论(0) 推荐(0) 编辑
摘要:Given an integer array sorted in ascending order, write a function to search target in nums. If target exists, then return its index, otherwise return 阅读全文
posted @ 2018-11-09 23:58 Grandyang 阅读(4674) 评论(1) 推荐(0) 编辑
摘要:Given the root node of a binary search tree (BST) and a value to be inserted into the tree, insert the value into the BST. Return the root node of the 阅读全文
posted @ 2018-11-06 12:09 Grandyang 阅读(3705) 评论(1) 推荐(0) 编辑
摘要:Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Retu 阅读全文
posted @ 2018-11-06 00:00 Grandyang 阅读(3128) 评论(0) 推荐(0) 编辑
摘要:Design your implementation of the circular double-ended queue (deque). Your implementation should support following operations: MyCircularDeque(k): Co 阅读全文
posted @ 2018-11-03 04:13 Grandyang 阅读(2825) 评论(0) 推荐(0) 编辑
摘要:Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (F 阅读全文
posted @ 2018-11-02 23:08 Grandyang 阅读(6193) 评论(4) 推荐(1) 编辑

Fork me on GitHub