【单选题】【消耗次数:1】
用顺序存储的方法将完全二叉树中所有结点逐层存放在数组a[1]~a[n]中,结点a[i]若有左孩子,其左孩子的编号为结点( )。
a[2i+1]
a[2i-1]
a[i/2]
a[2i]
参考答案:
复制
纠错
相关题目
【单选题】 用顺序存储的方法将完全二叉树中的所有结点逐层存放在数组中R[1..n],结点R[i]若有左孩子,其左孩子的编号为结点( )。
①  R[2i+1]
②  R[2i]
③  R[i/2]
④  R[2i-1]
【单选题】 一棵有n个结点的二叉树,按层次从上到下,同一层从左到右顺序存储在一维数组A[1..n]中,则二叉树中第i个结点(i从1开始用上述方法编号)的右孩子在数组A中的位置是()。
①  A[2i](2i=n)
②  A[2i+1](2i+1=n)
③  A[i-2]
④  条件不充分,无法确定
【单选题】 在一棵二叉树中,若编号为i的结点是其双亲结点的右孩子,则双亲结点的顺序编号为( )。
①  A.i/2.0
②  B.i/2+1
③  C.2i+1
④  D.i/2向下取整
【单选题】 在一棵二叉树中,若编号为i的结点存在双亲结点,则双亲结点的顺序编号为( )。
①  A.i/2.0
②  B.i/2向下取整
③  C.2i+1
④  D.i+2
【单选题】 在一棵二叉树中,若编号为5的结点存在左孩子,则左孩子的顺序编号为( )。
①  A.9
②  B.10
③  C.11
④  D.12
【单选题】 一棵二叉树高度为h,所有结点的度或为0,或为2,则这棵二叉树最少有( )结点。
①  2h
②  2h-1
③  2h+1
④  h+1
【单选题】 在一棵二叉树中,编号为17的结点的双亲结点的的顺序编号为( )。
①  A.34
②  B.7
③  C.9
④  D.8
【判断题】 一棵有18个结点的二叉树,其2度结点数的个数为8,则该树共有1个1度结点
①  正确
②  错误
【单选题】 设一棵采用链式存储的二叉树,除叶结点外每个结点度数都为2,该树结点中共有2n个指针域为空。则该树有( )个叶结点。
①  A.2n
②  B.2n+1
③  C.2n+2
④  D.N
【判断题】 具有12个结点的完全二叉树有5个度为2的结点。
①  正确
②  错误
随机题目
【单选题】 A: I won the 100 metre race. B: [填空].
①  Best wishes
②  Good luck
③  Right
④  Congratulations
【单选题】 A: Sir, do all the buses go downtown?B: [填空].
①  No,never mind
②  Sorry,Im new here
③  Pretty well,I guess
④  Wow,you got the idea
【单选题】 A: Im going to ask for a pay rise. B: [填空]
①  I think you cant do it.
②  Let me pay for it
③  I think you may talk to your boss
④  I dont think you are worth.
【单选题】 A: Lets eat out, shall we? B: Im broke. Ive gone through my paycheck for the week already. A: Dont worry. [填空].
①  Lets split the bill
②  We can find a way
③  Its my treat
④  Just fast food
【单选题】 A: I go to the gym twice a week. B: [填空] You look really fit and healthy.
①  Thats right!
②  I can tell.
③  No way!
④  Poor you!
【单选题】 A: Could you put the books on bookshelves, please? B: Of course. [填空] A: Thats all. Everything else has been done.
①  Its a pleasure to help.
②  Is that all?
③  Im free now.
④  How should I do it?
【单选题】 A: Ive got a really bad cough. B: [填空]
①  Why are you so careless about yourself?
②  This kind of thing happens to everyone.
③  You should take good care of yourself.
④  Oh, thats too bad. Why dont you take some aspirin?
【单选题】 A: I have booked a single room for today and tomorrow. B: [填空].
①  Thats all right
②  Ill check
③  Im sure
④  I know
【单选题】 A: What does your father do? B: [填空].
①  He is cleaning the street
②  He is fifty
③  He is a worker
④  He is all right
【单选题】 A: Did you use to play the violin? B: [填空].
①  Yes, I do
②  No, I didnt
③  Yes, I play it every day.
④  No, I do