Hello, I am thinking something about what to do...
zakanun / discussing-algorithm Goto Github PK
View Code? Open in Web Editor NEW刷一下算法题
刷一下算法题
Hello, I am thinking something about what to do...
代码放得比较简陋,点击链接去到的地方,通过题目来搜索就可以定位到对应的代码块
2021.03.17
遍历二叉树最基本的三种方式:144.前序遍历、94.中序遍历、145.后序遍历
三种遍历的差别在与先拿到哪个节点,这在代码中能清晰得知(从前一直区分不了这三种遍历,想了一下原因在于当年不知道咋的总结出来的口诀,是错的.....若是通过代码记忆,效果应该会好一些)
public void binTreeTraversal(TreeNode treeNode) {
if (treeNode == null) {
return;
}
// 前序遍历拿值
binTreeTraversal(treeNode.getLeft())
// 中序遍历拿值
binTreeTraversal(treeNode.getRight())
// 后序遍历拿值
}
先将基本的遍历方式记住,然后再实践其他树的题目。代码链接
2021.09.01
165. 比较版本号
能够想出来的方法就是以 . 为分隔符对两个版本号字符串进行划分(注意在 Java 中调用 split 时,. 需要使用 \. 进行转义)遍历拿到切割后的字符串数组,分别比较对应下标的数字的大小,直至结束。
题解中还提供了一种将空间复杂度将为常量的方式,就是巧妙的获取 . 之前的数进行比较,具体在代码中也有体现。
记录一下每日一题(为了拿到力扣全家桶周边(^^))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.