Which traversal method for a binary tree does the following Pascal code illustrate? procedure traverse (p:pointer); begin if p<>nil then begin traverse(p ↑ .left); process(p); traverse(p ↑ .right); end end;A.preorderB.postorderC.reorderD.inorder

题目

Which traversal method for a binary tree does the following Pascal code illustrate? procedure traverse (p:pointer); begin if p<>nil then begin traverse(p ↑ .left); process(p); traverse(p ↑ .right); end end;

A.preorder

B.postorder

C.reorder

D.inorder


相似考题
更多“Which traversal method for a binary tree does the following Pascal code illustrate? proced ”相关问题
  • 第1题:

    In the forest corresponding to the following binary tree,how many children does node B have?

    A. 1

    B.2

    C.3

    D.4


    正确答案:A

  • 第2题:

    You need to serialize an object of type List<int> in a binary format.The object is named data.Which code segment should you use?()

    A.

    B.

    C.

    D.


    参考答案:A

  • 第3题:

    The search method processed only on sequential storage is(75)。

    A.sequential search

    B.binary search

    C.tree search

    D.hash search


    正确答案:B
    解析:本题考查专业英语应用能力。参考译文:只能处理顺序存储的查找方法是二分法查找。

  • 第4题:

    Which of the following words is entirely arbitrary?

    A.tree
    B.typewriter
    C.crash
    D.bang

    答案:A
    解析:
    tree是一个任意词。

    crash是一个缩略语,故排除。

    typewriter是复合词,故排除。

    bang是拟声词,故排除。

    所以只有tree的形成比较任意,综上,A选项正确。

    故A选项正确。

  • 第5题:

    Which two of the following values does STP take into consideration when it elects the root bridge?()

    • A、The BPDU version number
    • B、The access layer bridge setting
    • C、The Bridge ID
    • D、The spanning-tree update number
    • E、The bridge priority
    • F、The VLAN number

    正确答案:C,E

  • 第6题:

    In which Spanning-Tree states does a switch port learn MAC addresses?()

    • A、Blocking
    • B、Listening
    • C、Forwarding
    • D、Learning
    • E、Relaying

    正确答案:C,D

  • 第7题:

    public class Plant {  private String name;  public Plant(String name) { this.name = name; }  public String getName() { return name; }  }  public class Tree extends Plant {  public void growFruit() { }  public void dropLeaves() { }  }  Which is true?() 

    • A、 The code will compile without changes.
    • B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.
    • C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.
    • D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.
    • E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.

    正确答案:D

  • 第8题:

    单选题
    You are developing a method to decrypt data that was encrypted with the Triple DES Algorithm. The method accepts the following parameters:  The byte array to be decrypted, which is named cipherMessage  The key, which is named key   An initialization vector, which is named iv  You need to decrypt the message by using the TripleDES class and place the result in a string.  Which code segment should you use?()
    A

    A

    B

    B

    C

    C

    D

    D


    正确答案: C
    解析: 暂无解析

  • 第9题:

    多选题
    You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()
    A

    In the init method.

    B

    In the jspInit method.

    C

    In the constructor of the JSP’s Java code.

    D

    In a JSP declaration, which includes an initializer block.

    E

    In a JSP declaration, which includes a static initializer block.


    正确答案: B,C
    解析: 暂无解析

  • 第10题:

    单选题
    public class Plant {  private String name;  public Plant(String name) { this.name = name; }  public String getName() { return name; }  }  public class Tree extends Plant {  public void growFruit() { }  public void dropLeaves() { }  }  Which is true?()
    A

     The code will compile without changes.

    B

     The code will compile if public Tree() { Plant(); } is added to the Tree class.

    C

     The code will compile if public Plant() { Tree(); } is added to the Plant class.

    D

     The code will compile if public Plant() { this(”fern”); } is added to the Plant class.

    E

     The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.


    正确答案: A
    解析: 暂无解析

  • 第11题:

    多选题
    In which Spanning-Tree states does a switch port learn MAC addresses?()
    A

    Blocking

    B

    Listening

    C

    Forwarding

    D

    Learning

    E

    Relaying


    正确答案: E,D
    解析: 暂无解析

  • 第12题:

    多选题
    Which of the following are spanning tree port states?()
    A

    Learning

    B

    Spanning

    C

    Listening

    D

    Forwarding

    E

    Initializing

    F

    Filtering

    G

    Permitting


    正确答案: E,D
    解析: 暂无解析

  • 第13题:

    Which traversal method for a binary tree does the following Pascal code illustrate? Procedure traverse(p:pointer); Begin Ifp<>NIL Then begin Traverse (p^.left); Process(p); Traverse(p^.right) End; End_

    A.pre_order

    B.middle_order

    C.none

    D.last_order


    正确答案:B

  • 第14题:

    Which two of the following values does STP take into consideration when it elects the root bridge? (Select two answer choices)

    A. The BPDU version number

    B. The access layer bridge setting

    C. The Bridge ID

    D. The spanning-tree update number

    E. The bridge priority

    F. The VLAN number


    正确答案:CE
    C,E 解析:Explanation:
    The bridges elect a root bridge based on the bridge IDs in the BPDUs. The root bridge is the bridge with the lowest numeric value for the bridge ID. Because the two part bridge ID starts with the priority value, essentially the bridge with the lowest priority becomes the root.

    For instance, if one bridge has priority 100, and another bridge has priority 200, the bridge with priority 100 wins, regardless of what MAC address was used to create the bridge ID or each bridge/switch.

  • 第15题:

    Traversing a binary tree in preorder is equivalent to(68).

    A.Traversing the forest corresponding to the binary tree in root-first order

    B.Traversing the forest corresponding to the binary tree in root-last order

    C.Traversing the forest corresponding to the binary tree in breadth-first order

    D.None of the above


    正确答案:A
    解析:前序遍历一个二叉树等价于按从树的根部、右子树、右子树查找顺序查找树。

  • 第16题:

    Which of the following may illustrate the difference between "competence" and__________ "performance"?

    A.What a person "knows" and what he/she "does".
    B.What a person "can do" and what he/she "does".
    C.What a person "does" and what he/she "knows".
    D.What a person "does" and what he/she "can do".

    答案:A
    解析:
    考查语言学知识。competence“语言能力”,指语言使用者对于语言规则系统的潜在意识;performance“语言运用”,指在具体场景中语言的实际运用,二者对应的分别为“knows”和“does”。故选A。

  • 第17题:

    You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()

    • A、In the init method.
    • B、In the jspInit method.
    • C、In the constructor of the JSP’s Java code.
    • D、In a JSP declaration, which includes an initializer block.
    • E、In a JSP declaration, which includes a static initializer block.

    正确答案:B,D,E

  • 第18题:

    Which WSDL style is suited to sending binary tree nodes as part of a SOAP message?()

    • A、 RPC/literal
    • B、 RPC/encoded
    • C、 Document/encoded
    • D、 Document/literal
    • E、 Document/literal wrapped

    正确答案:B

  • 第19题:

    单选题
    Which WSDL style is suited to sending binary tree nodes as part of a SOAP message?()
    A

     RPC/literal

    B

     RPC/encoded

    C

     Document/encoded

    D

     Document/literal

    E

     Document/literal wrapped


    正确答案: B
    解析: 暂无解析

  • 第20题:

    单选题
    In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()
    A

    Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.

    B

    Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.

    C

    Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.

    D

    Create an HttpSessionListener class and implement the sessionCreated method with that block of code.


    正确答案: A
    解析: 暂无解析

  • 第21题:

    单选题
    Your web page includes a Java SE v1.5 applet with the following declaration: 11. 13. 14. Which HTTP method is used to retrieve the applet code?()
    A

    GET

    B

    PUT

    C

    POST

    D

    RETRIEVE


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    Which of the following about ISM Code is not right?()
    A

    It aims to ensure safety at sea

    B

    It aims to avoid damage to the environment

    C

    It aims to prevent human injury or loss of life

    D

    It aims to provide a method to run a company


    正确答案: A
    解析: 暂无解析

  • 第23题:

    多选题
    Which two of the following values does STP take into consideration when it elects the root bridge?()
    A

    The BPDU version number

    B

    The access layer bridge setting

    C

    The Bridge ID

    D

    The spanning-tree update number

    E

    The bridge priority

    F

    The VLAN number


    正确答案: D,C
    解析: 暂无解析