LeetCode 精选算法 200 题
上下翻转二叉树
给你一个二叉树的根节点
root
,请你将此二叉树上下翻转,并返回新的根节点。你可以按下面的步骤翻转一棵二叉树:
原来的左子节点变成新的根节点
原来的根节点变成新的右子节点
原来的右子节点变成新的左子节点
1 | var upsideDownBinaryTree = function(root) { |
链表
链表相加
1 |
|
链表排序
1 | function sortInList(head) { |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Lavender's blog!