本文转自:http://m.biancheng.net/view/2808.html 在我们学习 C# 语言的过程中会发现之前的应用程序中默认会生成一个主方法 Main(),它是执行程序的入口和出口。方法是将完成同一功能的内容放到一起,方便书写和调用的一种方式,也体现了面向对象语言中封装的特性。定义 ...
Problem : Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: ...
分类:
其他好文 时间:
2020-04-18 22:43:40
阅读次数:
74
Problem : Given a non empty array of non negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elemen ...
分类:
其他好文 时间:
2020-04-18 18:27:07
阅读次数:
49
Problem : Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Example 2: Note: Le ...
分类:
其他好文 时间:
2020-04-18 14:06:13
阅读次数:
59
Problem : Given a non negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you ...
分类:
其他好文 时间:
2020-04-18 13:33:58
阅读次数:
75
RESET is a flag in TCP packets to indicate that the conection is not longer working. So, if any of the two participants in a TCP connection send a pac ...
分类:
其他好文 时间:
2020-04-18 09:16:18
阅读次数:
74
题目地址: "https://leetcode cn.com/problems/two sum/" 1.暴力解法 直接双重循环,枚举出所有可能的解,时间复杂度为O(n^2),空间复杂度为O(1) 2.HashTable 第一次循环将数组nums中的每个数都放入map中 第二次循环判断target n ...
分类:
其他好文 时间:
2020-04-17 00:50:56
阅读次数:
61
In the wilds far beyond lies the Land of Sacredness, which can be viewed as a tree — connected undirected graph consisting of nn nodes and n?1n?1 edge ...
分类:
其他好文 时间:
2020-04-17 00:11:27
阅读次数:
66
Problem: A?+?B is a problem used to test one's basic knowledge for competitive programming. Here is yet another boring variation of it. You have two i ...
分类:
其他好文 时间:
2020-04-16 22:50:39
阅读次数:
182
归并排序(MERGE SORT)是利用归并的思想实现的排序方法,该算法采用经典的分治(divide and conquer)策略(分治法将问题分(divide)成一些小的问题然后递归求解, 而治(conquer)的阶段则将分的阶段得到的各答案"修补"在一起,即分而治之)。 简而言之、就是将一个整体得 ...
分类:
编程语言 时间:
2020-04-16 19:29:42
阅读次数:
66