自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 资源 (1)
  • 问答 (3)
  • 收藏
  • 关注

原创 git克隆的代码如何传到新仓库?

git克隆的代码如何传到新仓库?

2023-02-22 14:03:06 567 1

原创 【linked-java】426.Convert Binary Search Tree to Sorted Doubly Linked List

Convert a BST to a sorted circular doubly-linked list in-place. Think of the left and right pointers as synonymous to the previous and next pointers in a doubly-linked list.Let’s take the following B...

2020-04-08 12:21:08 181

原创 【linked-java】369.Plus One Linked List

Given a non-negative number represented as a singly linked list of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.Example:Input...

2020-04-08 01:24:21 194

原创 【array-java】1011. Capacity To Ship Packages Within D Days

A conveyor belt has packages that must be shipped from one port to another within D days.The i-th package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on...

2020-03-23 16:27:17 239

原创 【array-java】835. Image Overlap

Two images A and B are given, represented as binary, square matrices of the same size. (A binary matrix has only 0s and 1s as values.)We translate one image however we choose (sliding it left, right...

2020-03-23 15:43:29 212

原创 【array-java】1267. Count Servers that Communicate

You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communic...

2020-03-23 15:19:35 155

原创 【array-java】78. Subsets

Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Example:Input: nums = [1,2,3]Output:[[3],[1],[2],...

2020-03-23 15:01:52 148

原创 【array-java】1151. Minimum Swaps to Group All 1's Together - Medium

Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together in any placein the array.Example 1:Input: [1,0,1,0,1]Output: 1Explanation:The...

2020-03-23 14:48:31 174

原创 【array-java】531. Lonely Pixel I

Given a picture consisting of black and white pixels, find the number of black lonely pixels.The picture is represented by a 2D char array consisting of ‘B’ and ‘W’, which means black and white pixel...

2020-03-23 09:35:46 200

原创 【array-java】238. Product of Array Except Self

Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Example:Input: [1,2,3,4]Output: [24...

2020-03-23 09:27:13 131

原创 【array-java】1375. Bulb Switcher III

There is a room with n bulbs, numbered from 1 to n, arranged in a row from left to right. Initially, all the bulbs are turned off.At moment k (for k from 0 to n - 1), we turn on the light[k] bulb. A ...

2020-03-22 15:39:26 203

原创 【array-java】695. Max Area of Island

Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrou...

2020-03-22 15:21:41 129

原创 【array-java】370. Range Addition

Assume you have an array of length n initialized with all 0’s and are given k update operations.Each operation is represented as a triplet: [startIndex, endIndex, inc] which increments each element o...

2020-03-22 14:54:46 115

原创 【array-java】282.Wiggle Sort

Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]…For example, given nums = [3, 5, 2, 1, 6, 4], one possible answer is [1, 6, 2, 5, 3, 4]....

2020-03-22 14:44:28 118

原创 【array-java】1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold

Given an array of integers arr and two integers k and threshold.Return the number of sub-arrays of size k and average greater than or equal to threshold.Example 1:Input: arr = [2,2,2,2,5,5,5,8], k ...

2020-03-22 14:25:42 186

原创 [array-java]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 twice in this array.Could you do it without extra sp...

2020-03-22 13:49:08 119

原创 【java-array】969. Pancake Sorting

Given an array A, we can perform a pancake flip: We choose some positive integer k <= A.length, then reverse the order of the first k elements of A. We want to perform zero or more pancake flips (...

2020-03-22 13:02:28 165

原创 【java-array】1338. Reduce Array Size to The Half

Given an array arr. You can choose a set of integers and remove all the occurrences of these integers in the array.Return the minimum size of the set so that at least half of the integers of the arr...

2020-03-19 16:41:07 250

原创 【java-array】723. Candy Crush 糖果消消乐

This question is about implementing a basic elimination algorithm for Candy Crush.Given a 2D integer array board representing the grid of candy, different positive integers board[i][j] represent diff...

2020-03-12 13:47:59 464

原创 【java-array】1222. Queens That Can Attack the King

On an 8x8 chessboard, there can be multiple Black Queens and one White King.Given an array of integer coordinates queens that represents the positions of the Black Queens, and a pair of coordinates k...

2020-03-09 11:08:17 232

原创 【java-np】1277. Count Square Submatrices with All Ones

Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.Example 1:Input: matrix =[[0,1,1,1],[1,1,1,1],[0,1,1,1]]Output: 15Explanation:There are 10 squares of...

2020-03-09 10:01:15 271

原创 【java】950. Reveal Cards In Increasing Order

In a deck of cards, every card has a unique integer. You can order the deck in any order you want.Initially, all the cards start face down (unrevealed) in one deck.Now, you do the following steps r...

2020-03-09 09:37:27 151

原创 【java】1329. Sort the Matrix Diagonally

Given a m * n matrix mat of integers, sort it diagonally in ascending order from the top-left to the bottom-right then return the sorted array.Example 1:Input: mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]...

2020-03-08 14:24:18 203

原创 【java】535. Encode and Decode TinyURL

Note: This is a companion problem to the System Design problem: Design TinyURL.TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it r...

2020-03-08 10:38:08 229

原创 【java】701. Insert into a Binary Search Tree

Given the root node of a binary search tree (BST) and a value to be inserted into the tree, insert the value into the BST. Return the root node of the BST after the insertion. It is guaranteed that th...

2020-03-08 08:44:51 158

原创 【java】1038. Binary Search Tree to Greater Sum Tree

Given the root of a binary search tree with distinct values, modify it so that every node has a new value equal to the sum of the values of the original tree that are greater than or equal to node.val...

2020-03-08 08:34:52 140

原创 【java】807. Max Increase to Keep City Skyline

In a 2 dimensional array grid, each value grid[i][j] represents the height of a building located there. We are allowed to increase the height of any number of buildings, by any amount (the amounts can...

2020-03-08 08:25:31 162

原创 1302. Deepest Leaves Sum

Given a binary tree, return the sum of values of its deepest leaves.Example 1:Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8]Output: 15Constraints:The number of nodes in the tree is bet...

2020-03-07 23:52:00 207

原创 1315. Sum of Nodes with Even-Valued Grandparent

Given a binary tree, return the sum of values of nodes with even-valued grandparent. (A grandparent of a node is the parent of its parent, if it exists.)If there are no nodes with an even-valued gra...

2020-03-07 23:24:57 223

原创 1282. Group the People Given the Group Size They Belong To

There are n people whose IDs go from 0 to n - 1 and each person belongs exactly to one group. Given the array groupSizes of length n telling the group size each person belongs to, return the groups th...

2020-03-07 22:40:44 140

原创 1265.Print Immutable Linked List in Reverse【java】

反转链表,该链表为单链表。public class Solution { public ListNode reverse(ListNode head) { ListNode prev = null; while (head != null) { ListNode temp = head.next; ...

2020-03-07 21:23:30 236

原创 自己写的java实现的多路搜索树 B-Tree

最近需要写范围查询的功能,最简单的应该是B+树吧,在了解B+树的时候,也看到了B-树。于是想先实现B-Tree再实现B+Tree,结果网上并没有找到B-Tree(多路搜索树),于是自己用java实现了一个,经过自己设计了很多测试用例,用Junit(临时学的)测试可用。在这里贴出来,希望能给初学者一点参考,也希望能有高人指点可以改进的地方,欢迎讨论批评指点!自己之前一直在做工程,这是一年多来首次写数据结构,自己还很弱,欢迎大家批评指正!!!

2016-01-20 21:35:39 820

原创 QT中关于arg()函数

这个函数应该是用参数替代字符串中的百分值,从小到大替换,%1--%99QT助手有一个例子如下[code=c]QString str;str = "%1 %2";str.arg("%1f", "Hello");        // returns "%1f Hello"str.arg("%1f").arg("Hello");    // returns "He

2014-11-18 10:17:50 6371

转载 特别喜欢也值得看的一篇文章

我始终认为,对一个初学者来说,IT界的技术风潮是不可追赶。我时常看见自己的DDMM们把课本扔了,去卖些价格不菲的诸如C#, VB.Net 这样的大部头,这让我感到非常痛心。而许多搞不清指针是咋回事的BBS站友眉飞色舞的讨论C#里面可以不用指针等等则让我觉得好笑。C#就象当年的ASP一样,“忽如一夜春风来,千树万树梨花开”,结果许多学校的信息学院成了“Web学院”。96,97级的不少大学生都

2012-05-04 19:22:03 640

原创 SQL 2008 从零基础到如今(不断更新中)

自从软件实践课老师留了一个作业后,便开始自学数据库,用了很多时间,进步不算多,但学会了很多东西。作业题目是   网上课程辅导与资源共享平台可能用到的知识有很多:HTML  .JSP.NET  数据库 等等对于我来说跟别人合作,自己选择了一个比较好学的吧,数据库    两天课余时间,包括熬夜到1点半,自学了SQL关系数据库标准语言。包括:模式定义与删除,表的定义、删除与修改、索引的建

2012-05-04 19:18:45 1356

c语言通讯录命令行程序

为大一期末写的程序设计,c语言通讯录命令行程序。包括设计要求,程序,自己截图用word做的使用手册。希望对大家有帮助。 建立一通讯录,输入姓名、电话号码、住址等信息,然后对通信录进行显示、查找、添加、修改及删除。 功能要求: 通讯录的每一条信息包括姓名、单位、固定电话、移动手机、分类(如同事、朋友、同学、家人等)、EMAIL、QQ等。 创建功能:创建通讯录,可以一次完成若干条信息的输入。 显示功能:完成全部通讯录信息的显示 查找功能:可以按姓名等多种方式查找通讯信息(最少实现一种) 增加、删除、修改功能:完成通讯录信息的多种更新算法。

2015-01-08

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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