数据流中的中位数

template<typename T> class DynamicArray { public: void Insert(T num) { if(((min.size() + max.size()) &a...

2018-03-31 08:36:49

阅读数:12

评论数:0

238. Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of ...

2018-03-30 08:44:13

阅读数:13

评论数:0

532. K-diff Pairs in an Array

Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an int...

2018-03-30 08:26:13

阅读数:9

评论数:0

442. Find All Duplicates in an Array

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twi...

2018-03-30 08:13:55

阅读数:10

评论数:0

448. Find All Numbers Disappeared in an Array

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] ...

2018-03-29 09:01:27

阅读数:11

评论数:0

283. Move Zeroes

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, giv...

2018-03-29 08:35:58

阅读数:15

评论数:0

406. Queue Reconstruction by Height

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the per...

2018-03-29 08:30:57

阅读数:11

评论数:0

260. Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements...

2018-03-28 08:56:42

阅读数:32

评论数:0

137. Single Number II

Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note:Your algorithm sh...

2018-03-28 08:42:57

阅读数:36

评论数:0

136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complex...

2018-03-28 08:33:10

阅读数:30

评论数:0

647. Palindromic Substrings

Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are c...

2018-03-27 08:30:11

阅读数:49

评论数:0

190. Reverse Bits

Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur...

2018-03-26 09:00:46

阅读数:28

评论数:0

338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and ...

2018-03-26 08:33:38

阅读数:25

评论数:0

NoSQL数据库的伸缩性设计

转载:http://www.360doc.com/content/17/1209/21/40769523_711635612.shtml

2018-03-24 07:53:45

阅读数:62

评论数:0

239. Sliding Window Maximum

Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k nu...

2018-03-23 08:38:58

阅读数:30

评论数:0

单例模式

#include <iostream> using namespace std; class Singleton { public: static Singleton *GetInstance() { if (m_Ins...

2018-03-22 13:52:46

阅读数:43

评论数:0

外观模式

外观模式是说为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。通俗点说就是通过定义一个一致的接口,用以屏蔽内部子系统的细节,使得调用端只需跟这个接口发生调用,而无需关心这个子系统的内部细节。外观模式中的角色:1.外观类(Facade)为调用端提供...

2018-03-22 11:12:15

阅读数:16

评论数:0

桥接模式

桥接模式(Bridge)是一种结构型设计模式。Bridge模式基于类的最小设计原则,通过使用封装、聚合及继承等行为让不同的类承担不同的职责。它的主要特点是把抽象(Abstraction)与行为实现(Implementation)分离开来,从而可以保持各部分的独立性以及应对他们的功能扩展。桥接模式的...

2018-03-22 10:54:19

阅读数:17

评论数:0

内存文件系统设计

Design an in-memory file system to simulate the following functions:ls: Given a path in string format. If it is a file path, return a list that only ...

2018-03-22 08:36:28

阅读数:57

评论数:0

LFU Cache

Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get andput.get(key) - Get th...

2018-03-21 08:54:17

阅读数:34

评论数:1

提示
确定要删除当前文章?
取消 删除
关闭
关闭