2018年2月的全部文章
@kidultff

平衡二叉树(AVL树)的基本操作

0x00、平衡二叉树的定义    平衡二叉树(AVL树)是一种特殊的二叉搜索树,只是在二叉搜索树上增加了对"平衡"的需求。    假如一棵二叉搜索树,按照“1,2,3,4,5”的顺序插入数据,会发现二叉树甚 ...
  • 0
  • 9
@kidultff

PAT-A 真题- 1076. Forwards on Weibo

原题干:Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1043. Is It a Binary Search Tree

原题干:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key.The right subtree of a node conta ...
  • 0
  • 0
@kidultff

C语言-二叉查找树(BST)

0x00、二叉查找树的递归定义    二叉查找树(二叉搜索树、二叉排序树、排序二叉树、Binary Search Tree,BST)是一种特殊的二叉树。递归定义如下:●若二叉查找树没有任何节点,则二叉查找树为空树●若二叉查找树不是空树,则二 ...
  • 0
  • 2
@kidultff

PAT-A 真题- 1053. Path of Equal Weight

原题干:Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R to any l ...
  • 0
  • 1