随笔分类 -  算法相关

每天一条leetcode,爽歪歪
摘要:正常的输入 C++: python: 按行输入 C++: python: C++中想要删掉一个string中的空格号 C++ include cout 阅读全文
posted @ 2018-02-27 20:59 戴怪兽 阅读(168) 评论(0) 推荐(0)
摘要:提到DFS,我们首先想到的是对树的DFS,例如下面的例子:求二叉树的深度 int TreeDepth(BinaryTreeNode* root){ if(root==nullptr)return 0; int left=TreeDepth(root->left); int right=TreeDep 阅读全文
posted @ 2017-09-14 21:55 戴怪兽 阅读(982) 评论(0) 推荐(0)
摘要:题目是: Given a string s,partition s such that every substring of the partition is a palindrome Return tthe mininum cuts needed for a palindrome partitio 阅读全文
posted @ 2017-09-13 19:22 戴怪兽 阅读(379) 评论(0) 推荐(0)