05 2017 档案
摘要:Python的WEB框架有Django、Tornado、Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM、模型绑定、模板引擎、缓存、Session等诸多功能。 本文将以下方面带大家全面了解Django框架,笔者使用的版本为1.10. 流程 一、 Django
阅读全文
摘要:原题 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level a
阅读全文
摘要:原题 Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree
阅读全文
摘要:原题 求二叉树的最大路径和 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to
阅读全文
摘要:原题 Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: Hints: If you notice carefully in
阅读全文
摘要:原题 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 neares
阅读全文
摘要:正则表达式 正则表达式是用来匹配字符串非常强大的工具,在其他编程语言中同样有正则表达式的概念。就其本质而言,正则表达式(或 RE)是一种小型的、高度专业化的编程语言,(在Python中)它内嵌在Python中,并通过 re 模块实现。正则表达式模式被编译成一系列的字节码,然后由用 C 编写的匹配引擎
阅读全文
摘要:原题 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains o
阅读全文
摘要:原题 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size
阅读全文
摘要:原题 Description: Count the number of prime numbers less than a non-negative number, n. 求小于n(非负数)的所有质数(素数)。 思路 埃拉托色尼筛选法——用于求一定范围内的质数(效率高,推荐) 详戳这里百度or维基
阅读全文
摘要:原题 Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Her
阅读全文