上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页
摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 0011100101111... 阅读全文
posted @ 2017-07-15 11:07 xiejunzhao 阅读(175) 评论(0) 推荐(0)
摘要: >>> '{0:.2f}'.format(1/3)'0.33'>>> '{0:b}'.format(10) #二进制'1010'>>> '{0:o}'.format(10) #八进制'12'>>> '{0:x}'.format(10) #16进制'a'>>> '{:,}'.format(12369132698) #千分位格式化'12,369,132,698 阅读全文
posted @ 2017-07-15 10:59 xiejunzhao 阅读(171) 评论(0) 推荐(0)
摘要: Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c.Example 1:Input: 5Output: TrueExplanation: 1 * 1 + 2 * 2 = 5Example 2:Input: 3Output:... 阅读全文
posted @ 2017-07-14 23:25 xiejunzhao 阅读(330) 评论(0) 推荐(0)
摘要: 原帖:http://blog.csdn.net/louishao/article/details/57075531 最后一张图,就是正式修改系统环境的,点击Path,加上python2和python3的安装目录,和各自目录下的Scrips目录。配置完系统变量后,将python3安装目录下的python.exe复制一份,并改名为python3.exe完成操作之后,可以在命令行中输入python、py... 阅读全文
posted @ 2017-07-14 00:16 xiejunzhao 阅读(316) 评论(0) 推荐(0)
摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by... 阅读全文
posted @ 2017-07-12 00:02 xiejunzhao 阅读(139) 评论(0) 推荐(0)
摘要: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.Example:... 阅读全文
posted @ 2017-07-09 23:23 xiejunzhao 阅读(290) 评论(0) 推荐(0)
摘要: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7 Output: [3, 14.5, 11] Explanation: T... 阅读全文
posted @ 2017-07-09 18:06 xiejunzhao 阅读(278) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.题意:给一个二叉树,求出根节点到叶子节点(终端结点)的最短路径解法:使用BFS广度优... 阅读全文
posted @ 2017-07-08 23:32 xiejunzhao 阅读(143) 评论(0) 推荐(0)
摘要: Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are:["1->2->5", "1->3"]# Definition for a binary tree ... 阅读全文
posted @ 2017-07-08 12:25 xiejunzhao 阅读(142) 评论(0) 推荐(0)
摘要: using System;using Newtonsoft.Json;using System.IO;using Newtonsoft.Json.Linq;namespace SQLHelper { class Program { static void Main(string[] args) { string strReadFilePath = @"data.json"; Stream... 阅读全文
posted @ 2017-07-02 18:27 xiejunzhao 阅读(2371) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页