关于Leetcode上二叉树的算法总结
二叉树,结构很简单,只是比单链表复杂了那么一丢丢而已。我们先来看看它们结点上的差异:/* 单链表的结构 */struct SingleList{int element;struct SingleList *next;};/* 二叉树的结构 */struct BinaryTree{int element;struct BinaryTree *left;struct BinaryTree *right;}; 根据以上两个结构,我们不难发现,单链表的结点只有一...