leetcode和算法
记录leetcode算法或其他遇到的算法
zmt6117
这个作者很懒,什么都没留下…
展开
-
二叉树前序、中序、后序、层次遍历Java实现
二叉树前序、中序、后序遍历主要就是递归实现。 层次遍历用队列进行实现。 前序遍历 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val ...原创 2020-04-08 13:52:43 · 92 阅读 · 0 评论 -
记录leetcode的一些解法
记录leetcode的一些解法1. Two Sum2. Add Two Numbers 1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would ha...原创 2019-03-27 20:14:58 · 1477 阅读 · 0 评论