软件说明本软件是为方便管理仓库的入库、出库、库存情况而设计。 主要功能:入库管理出库管理库存管理综合信息管理用户管理。
QuestionGiven an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at
QuestionImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note:
Question我在使用Swingworker时出现了进度条不更新的问题。
QuestionFind the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example, Given [3,2,1,5,6,4] and k = 2, r
QuestionGiven an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute dif
QuestionGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot
QuestionReverse a singly linked list.本题难度Easy。3指针法复杂度时间 O(N) 空间 O(1) 思路利用3个指针对链表实施reverse。代码/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; *
QuestionNote: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This
QuestionGiven an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, given the array
在eclipse中对java工程打包,需要用到清单文件 MANIFEST.MF。
Rotate Image
Jump Game II
Group Anagrams
Question Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.本题难度Hard。 【思路】 N-Queens中返回棋盘变成了解的个数。不必多说。【代码】public class Solution
Question Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example, Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Yo
Question Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,
Question本题难度Hard。排序+双指针【复杂度】 时间 O(Nlog(N)) 空间 O(N) 【思路】 先按照每个元素的start从小到大进行排序。然后利用双指针法,设置区间(low,high),如果新的元素i的start要大于high,说明(low,high)没有overlap,就将(low,high)放入结果中,然后将双指针移动:low=i.start;high=i.end;否
Question Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.
Question Given a list, rotate the list to the right by k places, where k is non-negative.For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL.本题难度Medium。双指针法【复杂度】 时间 O(N) 空
Question Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is
Question The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):“123” “132” “213” “2
Question A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach
Question Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or rig
在利用Recursion Algorithm进行树遍历时,需要注意:1、当要修改诸如List类变量时,不要影响到后面的递归调用。 例如: [LeetCode]Permutationsprivate void helper(List<Integer> preList,List<Integer> remains,List<List<Integer>> ans){ //bound if(
Question Given two binary strings, return their sum (also a binary string).For example, a = "11" b = "1" Return "100".本题难度Easy。但是不要小觑。【复杂度】 时间 O(N) 空间 O(1) 【思路】 模拟加法的运算法则,从最低位加到最高位。【注意】 1、本题不必使
Question Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.For example, Given n = 3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ],
Question Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of e
Question You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?本题难度Easy。有3种算法分别是: 递归、迭代、数学
Question Follow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the g
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号