上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 37 下一页
摘要: Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [9,4] Exam 阅读全文
posted @ 2019-01-06 17:03 fatttcat 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Design a max stack that supports push, pop, top, peekMax and popMax. Example 1: Note: 基本思路同 153. Min Stack,用两个stack 注意popMax()的时候要先把stack中的元素pop出来,直到找 阅读全文
posted @ 2019-01-06 15:49 fatttcat 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2019-01-05 04:39 fatttcat 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2019-01-04 17:28 fatttcat 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文
posted @ 2019-01-04 13:29 fatttcat 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given an array that is initially stored in one stack, sort it with one additional stacks (total 2 stacks). After sorting the original stack should con 阅读全文
posted @ 2019-01-04 13:07 fatttcat 阅读(349) 评论(0) 推荐(0) 编辑
摘要: Given one stack with integers, sort it with two additional stacks (total 3 stacks). After sorting the original stack should contain the sorted integer 阅读全文
posted @ 2019-01-03 18:06 fatttcat 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. Example: 380. Insert Delete 阅读全文
posted @ 2019-01-03 15:32 fatttcat 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. Example: insert, delete 用hashmap操作,get random用arraylist,map存<val, 阅读全文
posted @ 2019-01-03 08:57 fatttcat 阅读(164) 评论(0) 推荐(0) 编辑
摘要: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to 阅读全文
posted @ 2019-01-03 08:02 fatttcat 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 37 下一页