- 31
- 0
- 约 12页
- 2017-06-10 发布于河南
- 举报
武汉理工大学2013年蓝桥杯试题(国外英文资料)
武汉理工大学2013年蓝桥杯试题(国外英文资料)
1 title: full binary tree
In general, binary trees are stored by data structures that contain Pointers. But for special cases, you can also simplify storage.
For example, in the case of a binary tree, all nodes have a complete left and right child, except for the last layer of leaves. We can put the nodes in an array according to the order of the tree. Of course, you need to compute its parent node or two child nodes from the sequence number of a node.
The goal of the code below is to find the parent of a node. Please fill in the missing code.
/ / return the parent nod
原创力文档

文档评论(0)