问题 单项选择题

在n个结点的线索二叉链表中,有()个线索指针。

A.n

B.n-1

C.n+1

D.n+10

答案

参考答案:C

解析:

线索二叉树是利用空闲的子链域来存放某种遍历次序下的直接前驱结点或直接后继结点的地址的二叉树。因为二叉树的每个结点有且仅有两个链域,则n个结点的二叉树,有2n个子链域。又因为除根结点之外,其他每个结点都有且仅有一个进入支,这样就共有n -1进入支;而这n-1分支是由上一层的结点的子链域发出的,因此, 2n个子链域中有,n-1个链域是指向子结点的,其他n+1个链域空闲看着。经过线索化以后,这些原来空闲着的n+1个链域被用来指向前驱或后继,即用来存放线索。所以在n个结点的线索二叉链表中,有n +1个线索指针。

阅读理解

A king in Africa had a close friend that helped him grow up. The friend had a habit of looking at everything positively(肯定)that happened in his life and saying “This is good”.

One day the king and his friend were out hunting. The friend would prepare the guns for the king. The friend did something wrong in preparing one of the guns, and after the gun from his friend, the king fired it and his thumb(拇指) was blown off. On seeing the situation the friend said as usual, “This is good!” The king replied, “No, this is not good!” He was very angry and sent his friend to jail(监狱).

About a year later, the king was hunting in a forest. Cannibals(食人者) caught him and took him to their village. As they were going to kill him, they noticed that the king was missing a thumb. They never ate anyone who was less than whole, so they sent the king back.

When he returned home, he felt sorry for his treatment of his friend. He went quickly to the jail to speak with his friend. “You were right”, he said. “It was good that thumb was blown off.” And he told the friend all that had just happened. “And so I am very sorry for sending you to jail for so long. It was bad for me to do this.”

“No,” his friend replied, “this is good!” “What do you mean? How could it be good that I sent my friend to jail for a year?” 

“If I had not been in jail, I would have been with you, and I would have been eaten!”

小题1:From the story we learn that ________.

A.the king was not a good friend indeed

B.the king’s friend always knew what would happen

C.the friend would say “This is Good !” when anything happened

D.the king was not good at hunting at all.小题2:The king was sent back by Cannibals because _______.

A.Cannibals never ate a king

B.the king’s friend was in jail

C.the king had a gun with him

D.the king missed his thumb小题3:The best title for the reading is _______.

A.The Lucky King

B.The Great Friend

C.Nothing Stops Real Friendship

D.Everything Happens for the Good

问答题 简答题