不积跬步无以至千里

不积小流无以成江海

C#中调试和错误的处理

正常模式下的调试 1,在vs中使用Console.Write(或者WriteLine)方法向控制台输出变量的值,通过这种形式来观察变量的值是否符合预期。 2,在Unity中可以使用Debug.Log(“”) Debug.LogError(“”) Debug.LogWarn(“”),想Unity...

2018-03-31 21:42:19

阅读数:346

评论数:0

231. Power of Two

1,题目要求 Given an integer, write a function to determine if it is a power of two. 即判断一个数是不是2的幂次。 2,跟前面求是否是3的幂次类似,可以直接套用那两种思想。 同时,可以用一种新的方式,适用于2的幂次的...

2018-03-31 14:46:50

阅读数:33

评论数:0

326. Power of Three

1,题目要求 Given an integer, write a function to determine if it is a power of three. 即给定一个数字,判断其是否是3的幂次。返回true false。 不要使用循环或者迭代。 2,题目思路 无法使用循环或者迭代...

2018-03-30 20:53:31

阅读数:23

评论数:0

21. Merge Two Sorted Lists

1,题目要求 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists....

2018-03-29 19:56:02

阅读数:18

评论数:0

405. Convert a Number to Hexadecimal

1,题目要求 将十进制的数字转换为十六进制的形式,并且要可以对负数进行转换。 2,题目思路 如果仅仅是对十进制的数字转换为十六进制,其实还是不难的,关键在于对负数应该如何去处理。 在这里面,负数是转化为补码的形式来进行运算的。 在参考的算法后,得到了如下的实现思路: 首先,定义一个...

2018-03-28 13:38:44

阅读数:19

评论数:0

257. Binary Tree Paths

1,题目要求 Given a binary tree, return all root-to-leaf paths. 2,题目思路 依然是利用递归的方法,对整棵树进行遍历,每当找到左右孩子节点都为空的节点时,便将这一条路径得到字符串加入到vector中;否则,就对左右子树分别进行路径的查...

2018-03-27 14:16:03

阅读数:40

评论数:0

594. Longest Harmonious Subsequence

1,题目要求 We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an in...

2018-03-26 13:49:20

阅读数:18

评论数:0

70. Climbing Stairs

1,题目要求 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 ...

2018-03-25 12:52:21

阅读数:16

评论数:0

720. Longest Word in Dictionary

1,题目要求 Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by...

2018-03-24 15:33:58

阅读数:23

评论数:0

对于未来的考量

既然已经下定决心要走游戏开发的路线,就不能在进行动摇了。 跟王哥交流了一番,看了几位直接获得提前面试资格的牛人的简历,发现个人的项目经历完全是可以进行自我实现的。比如一位自己实现了简单的linux内核,就是完美的闪光点。在游戏服务器开发的领域,就很需要有这方面才能的人。 对于游戏开发,自己的作...

2018-03-23 21:25:18

阅读数:32

评论数:0

202. Happy Number

1,题目要求 Write an algorithm to determine if a number is “happy”. A happy number is a number defined by the following process: Starting with any posit...

2018-03-23 19:45:26

阅读数:28

评论数:0

415. Add Strings

1,题目要求 Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num...

2018-03-22 14:46:19

阅读数:12

评论数:0

671. Second Minimum Node In a Binary Tree

1,题目要求 Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero s...

2018-03-21 10:50:25

阅读数:19

评论数:0

747. Largest Number At Least Twice of Others

1,题目要求 In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice ...

2018-03-20 10:15:30

阅读数:35

评论数:0

107. Binary Tree Level Order Traversal II

1,题目要求 Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to ro...

2018-03-19 14:33:25

阅读数:22

评论数:0

674. Longest Continuous Increasing Subsequence

1,题目要求 Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). 找到一个连续的最长递增子序列。 2,题目思路 还是利...

2018-03-18 11:01:28

阅读数:29

评论数:0

121. Best Time to Buy and Sell Stock

1,题目要求 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one t...

2018-03-17 14:30:35

阅读数:27

评论数:0

746. Min Cost Climbing Stairs

1,题目要求 On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or tw...

2018-03-16 20:30:46

阅读数:26

评论数:0

541. Reverse String II

1,题目要求 Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If...

2018-03-15 22:42:27

阅读数:22

评论数:0

504. Base 7

1,题目要求 将一个数转化为7进制的数 注意转化为一个字符串。 2,题目思路 对于负数,要进行记录并将其转化为正数再进行操作。 跟在十进制时获得每一位的数字时的方法相同,只不过将10变为7即可。 3,程序源码 class Solution { public: stri...

2018-03-14 15:32:28

阅读数:19

评论数:0

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