Lintcode1 A+B Problem solution 题解
原创 2017-04-07 19:22:33
445阅读
Lintcode1 A+B Problem solution 题解
原创 2017-04-07 16:19:05
426阅读
Lintcode1 A+B Problem solution 题解
原创 2017-04-07 19:22:44
460阅读
URL:https://www.lintcode.com/problem/counting-bits/description:描述给出一个 非负 整数 num,对所
原创 2019-11-17 22:13:23
82阅读
Data Stream MedianNumbers keep coming, return the median of numbers at every time a new number added.Have you met this question in a real interview?Ex...
转载 2015-12-08 20:24:00
50阅读
2评论
Using O(1) time to check whether an integer n is a power of 2.ExampleFor n=4, return trueFor n=5, return falseChallengeO(1) timeTags Expand 这道题考察bit m...
转载 2015-04-02 05:24:00
49阅读
Using O(1) time to check whether an integer n is a power of 2. Example For n=4, return true; For n=5, return false; Challenge O(1) time思路:如果n是2的幂,则n的二进制表示中只有一个1. 用n&(n-1),如果结果是0则表示只有一个1.
原创 2022-12-01 18:27:44
39阅读
    博主之前在学习 python 的数据结构与算法的基础知识,用的是《problem-solving-with-algorithms-and-data-structure-using-python》 。但是仅仅看书对于知识的理解不够深入。于是选择了 lintcode 刷题,本篇博客即为最近做的算法题的一则小结。     lintcode 的界面非常干净,还有中文版本的。博主的刷题的顺序为从入门
转载 2018-05-03 14:55:00
93阅读
2评论
给出两个整数a和b, 求他们的和, 但不能使用+等数学运算符说明a和b都是32位整数么?是的我可以使用位运算符么?当然可以样例如果a=1并且b=2,返回3由
原创 2021-04-24 23:51:12
488阅读
原题链接在这里:http://www.lintcode.com/en/problem/heapify/ 题目: Given an integer array, heapify it into a min-heap array. For a heap array A, A[0] is the root
转载 2017-02-09 05:49:00
138阅读
2评论
You have two every large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of
转载 2016-02-08 23:45:00
93阅读
2评论
Given a list of numbers, return all possible permutations.Challenge Do it without recursion.1.递归class Solution {public: st of permu
原创 2022-12-01 18:29:49
95阅读
Given a triangle, find the minimum path sum from top to bottom. Eac
原创 2022-12-01 19:09:16
51阅读
Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill this backpack?Example If we have 4 items with size [2, 3, 5, 7], the backpack size is 11, we can select [
原创 2022-12-01 19:13:44
30阅读
http://lintcode.com/en/problem/rehashing/# /**  * Definition for ListNode  * public class ListNode {  *     int val; &nb
原创 2015-01-14 15:09:02
746阅读
easy 子树 19% 通过 有两个不同大小的二进制树: T1 有上百万的节点; T2 有好几百的节点。请设计一种算法。判定 T2 是否为 T1的子树。 您在真实的面试中是否遇到过这个题? Yes 例子 以下的样例中 T2 是 T1 的子树: 1 3 / \ / T1 = 2 3 T2 = 4 /
转载 2016-04-11 11:07:00
121阅读
原题链接在这里:http://www.lintcode.com/en/problem/subtree/ You have two every large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes.
转载 2016-02-13 23:31:00
104阅读
2评论
Given a set of distinct integers, return all possible subsets.Challenge Can you do it in both recursively and iterati
原创 2022-12-01 18:30:02
73阅读
http://lintcode.com/en/problem/backpack/ public class Solution {     /**      * @param m: An integer m denot
原创 2015-01-12 06:02:16
1008阅读
Given n items with size A[i], an integer m denotes the size of a backpack. How full you can fill this backpack? NoteYou can not divide any item into s...
转载 2015-02-03 09:14:00
83阅读
  • 1
  • 2
  • 3
  • 4
  • 5