06 2018 档案
摘要: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 l
阅读全文
摘要: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 dep
阅读全文
摘要:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced bina
阅读全文
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d
阅读全文
摘要: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 root). For
阅读全文
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example,
阅读全文
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example,
阅读全文
摘要: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 and
阅读全文
摘要: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 [3
阅读全文
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l
阅读全文
摘要:接口:Interface 接口是干嘛的呢?可以说接口主要就是来实现多态性。 多态性又是什么呢?多个态势。举一个例子,就可以把接口和多态非常好的理解。 以生活中点外卖为例子: 美团外卖: 饿了吗外卖 现在我需要叫外卖 在没有接口的情况下我们是这样写的,问题来了 如果你又加了一个百度外卖,那么eat函数
阅读全文
摘要:质量高的代码关键之一是具有可维护性和可扩展性。 将面向对象设计,也就是解耦,融入于编码之中。不要硬编码,要让你的代码扩展起来十分方便。 今天我遇到了一个问题: 面向对象的ISP原则。 接口隔离原则,具体来说就是客户程序无需被迫依赖于它用不到的方法. 比如我又这样一个抽象类,类中有一个方法叫做Add(
阅读全文
摘要:写一个质量高的代码,关键之一是可读性。 可读性的关键之一是你要有一个好的且固定的代码规范: 首先C#中的命名约定有两种: Pascal:每个单词的首字母大写,例如ProductType; Camel:首个单词的首字母小写,其余单词的首字母大写,例如productType 1. 缩进不用tab建,使用
阅读全文
摘要:前言: 对于SVM的了解,看前辈写的博客加上读论文对于SVM的皮毛知识总算有点了解,比如线性分类器,和求凸二次规划中用到的高等数学知识。然而SVM最核心的地方应该在于核函数和求关于α函数的极值的方法:SMO算法(当然还有很多别的算法。libsvm使用的是SMO,SMO算法也是最高效和简单的),还有松
阅读全文