ActiveCoder
码龄9年
关注
提问 私信
  • 博客:109,609
    109,609
    总访问量
  • 345
    原创
  • 1,207,068
    排名
  • 4
    粉丝
  • 0
    铁粉

个人简介:An active programmer

IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:加拿大
  • 加入CSDN时间: 2016-03-18
博客简介:

ActiveCoder的博客

博客描述:
Algorithms seen
查看详细资料
个人成就
  • 获得1次点赞
  • 内容获得1次评论
  • 获得2次收藏
创作历程
  • 354篇
    2016年
成就勋章
TA的专栏
  • LeetCode 题解
    288篇
  • LintCode 题解
    6篇
  • Cracking Code
    7篇
  • Facebook
    39篇
  • Google
    9篇
  • Life
    3篇
  • TopCoder
  • Dynamic Programming
    13篇
  • Backtrack
    5篇
  • Multiple Passes
    85篇
  • Binary Search
    3篇
  • Elements
    1篇
  • Websites
  • Design pattern
    4篇
  • Online interview
    1篇
  • Onsite Interview
  • System Design
  • C++ Concepts
    3篇
  • TODO
    2篇
创作活动更多

仓颉编程语言体验有奖征文

仓颉编程语言官网已上线,提供版本下载、在线运行、文档体验等功能。为鼓励更多开发者探索仓颉编程语言,现诚邀各位开发者通过官网在线体验/下载使用,参与仓颉体验有奖征文活动。

368人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

Sort Stack in increasing/decreasing Order.

Question: Sort a stack in increasing order. Two ways: sort it recursively and use an explicit stack.// solve it recursivelyvoid insertToStack(stack& s, int value) { if(s.empty() || s.top() <= val
原创
发布博客 2016.08.07 ·
443 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Delete node in BST

Question: delete the given value in BST.This question is pretty tricky, to delete a node in BST, there are several cases to consider.1: The node one of the leavesin this case, it is easy, ju
原创
发布博客 2016.08.06 ·
386 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Observer Pattern

Observer Pattern: defines a one-to-many dependency between objects so that when one object changes state, all of its dependent are notified and updated automatically.The relationship is defined as f
原创
发布博客 2016.08.05 ·
324 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Decorating Pattern

Decorate pattern is to give objects new responsibilities without making any code change to the underlying classes. The Decorator Pattern attaches additional responsibilities to an object dynamically.
原创
发布博客 2016.08.03 ·
360 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Command Pattern

Command Pattern is usually used in the scenario that we want to perform multiple operations on the same data. For example, in a image processor, we could choose to rotate, flip or invert colors of the
原创
发布博客 2016.08.02 ·
318 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Virtual Table -- C++

Vtables is also known as many different names: virtual function table, virtual method table, and even as a dispatch table.Usage of Vtables: Polymorphismwhen working with virtual function in C++, i
原创
发布博客 2016.08.01 ·
424 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Strategy Pattern

The strategy pattern is to take the parts that vary and encapsulation them, so that later you can alter or extend the parts that vary without affecting those that don't.In the head first design patt
原创
发布博客 2016.08.01 ·
266 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Balanced Partition of Array

Given an array which contains random positive integers, divide the array into two parts which has the smallest diff sum, return the smallest diff sum.This problem is solvable using dynamic programmi
原创
发布博客 2016.07.27 ·
527 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode 375. Guess Number Higher or Lower II

We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number I pi
原创
发布博客 2016.07.26 ·
578 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

374. Guess Number Higher or Lower

We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number is h
原创
发布博客 2016.07.25 ·
238 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

LeetCode 366. Find Leaves of Binary Tree

Given a binary tree, find all leaves and then remove those leaves. Then repeat the previous steps until the tree is empty.Example:Given binary tree  1 / \ 2 3
原创
发布博客 2016.07.25 ·
311 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Maximum array distance Sum

Question: Given an array, find the maximum array distance sum. Array distance sum is defined as below. For any 0 For example, Given array {0, 2, -1}A[0][0] = 0, A[0][1] = 3, A[0][2] = 1; A[1][1] =
原创
发布博客 2016.07.25 ·
239 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Dynamic Programming series

DP is absolutely the best way to category levels of programming..... and it is always the favourite questions being asked by FB or Google.1: Entry Level DP problem.    /* A sequence of numbers i
原创
发布博客 2016.07.21 ·
294 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

TODO: house robber IIII

TODO: when rob one, the neighbour explored, get the max rob value.
原创
发布博客 2016.07.20 ·
255 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

TODO: System design a recommendation system

TODO: design a recommendation system.
原创
发布博客 2016.07.18 ·
304 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Shuffle related problem.

Shuffle is quite a frequently asked question in interviews. The most famous one is shuffle a deck of cards.Peiyush Jain, 2004 published a paper "A simple in-place Algorithm for in-Shuffle". However
原创
发布博客 2016.07.18 ·
605 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Haffman Encoding and Decoding

Read this blog and it seems this is a quite decent interview question. Haffman encodingHaffman encoding is  a classic way to encode characters. It encodes characters according to building an optimis
转载
发布博客 2016.07.18 ·
298 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Find Closet Pairs -- To be continue

1: Find closet pair number in an given array2: Find closet pair of points in an array of given points.3: Given a set of triangles, find the most overlapped points.  (TODO: Will update them on July
原创
发布博客 2016.07.09 ·
369 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Subarray Sum to the given target value

Question: check if there is a subarray sum equals to the given target.This question should ask for clarifications. Whether the inputs are all positive, or it has negative numbers.1: If all the num
原创
发布博客 2016.07.07 ·
547 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Primes Product

Maybe think about how to solve it iteratively??#include "header.h"using namespace std;void primeProduct(vector& nums, vector& res, int product, int pos) { if(pos > nums.size()) { return;
原创
发布博客 2016.07.07 ·
313 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多