个人博客:枫之羽目录前言入门题37. 反转一个3位整数145. 大小写转换452. 删除链表中的元素454. 矩阵面积463. 整数排序466. 链表节点计数479. 数组第二大数484. 交换数组两个元素763. 进制转换632. 二叉树的最大节点简单题1. A + B 问题2. 尾部的零6. 合并排序数组 II8. 旋转字...
原创
2021-07-06 15:57:41
206阅读
http://lintcode.com/en/problem/rehashing/# /**
* Definition for ListNode
* public class ListNode {
* int val;
&nb
原创
2015-01-14 15:09:02
770阅读
easy 子树 19% 通过 有两个不同大小的二进制树: T1 有上百万的节点; T2 有好几百的节点。请设计一种算法。判定 T2 是否为 T1的子树。 您在真实的面试中是否遇到过这个题? Yes 例子 以下的样例中 T2 是 T1 的子树: 1 3 / \ / T1 = 2 3 T2 = 4 /
转载
2016-04-11 11:07:00
146阅读
原题链接在这里: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
115阅读
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
78阅读
原题链接在这里: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
146阅读
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
98阅读
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
98阅读
Given a triangle, find the minimum path sum from top to bottom. Eac
原创
2022-12-01 19:09:16
61阅读
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
43阅读
http://lintcode.com/en/problem/backpack/ public class Solution {
/**
* @param m: An integer m denot
原创
2015-01-12 06:02:16
1022阅读
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
91阅读
Given two integers n and k, return all possible combinatio
原创
2022-12-01 19:03:45
80阅读
博主之前在学习 python 的数据结构与算法的基础知识,用的是《problem-solving-with-algorithms-and-data-structure-using-python》 。但是仅仅看书对于知识的理解不够深入。于是选择了 lintcode 刷题,本篇博客即为最近做的算法题的一则小结。
lintcode 的界面非常干净,还有中文版本的。博主的刷题的顺序为从入门
转载
2018-05-03 14:55:00
115阅读
2评论
http://lintcode.com/en/problem/backpack-ii/ public int backPackII(int m, int[] A, int V[]) {
&
原创
2015-01-12 06:41:49
544阅读
这道题参考了网上一些很好的思路: method1: Record the pre nodes of every node, then find out a node without pre node in each iteration and delete this node from unvisi
转载
2015-04-16 12:29:00
82阅读
2评论
Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. Each query has two integers [start, end]. For each
转载
2016-02-02 04:46:00
72阅读
Determine the number of bits required to flip if you want to convert integer n to integer m.Have you met this question in a real interview? YesExample...
转载
2016-01-06 04:34:00
160阅读
Given n pieces of wood with length L[i] (integer array). Cut them into small pieces to guarantee you could have equal or more than k pieces with the s...
转载
2016-01-06 05:59:00
104阅读
Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the l...
转载
2015-04-06 12:48:00
134阅读