Tskafli8

13 Questions

Settings
Please wait...
Tskafli8

Spurningar úr kaflanum: (kafli 8)


Questions and Answers
  • 1. 
    Suppose a binary tree contained the nodes W,X,Y and Z. If W and X were children of Y and Z had no children, which node would be the root?
    • A. 

      Y

    • B. 

      X

    • C. 

      Z

    • D. 

      W

  • 2. 
    Suppose you were going to retrieve items of data that you would later need to process in the opposite order from that in which they were retrived. Which of the following would be the best structure in which to store the items?
    • A. 

      Traditional linked list

    • B. 

      Stack

    • C. 

      Tree

    • D. 

      Queue

  • 3. 
    If the two-dimensional array X were stored in row-major order, then in the block of main mermory containing X, which of the following would be true?
    • A. 

      The entry X[1,2] would be in the same location as X[2,1]

    • B. 

      The entry X[1,2] would be appear before X[2,1]

    • C. 

      The entry X[1,2] would appear after X[2,1]

    • D. 

      None of the above

  • 4. 
    If the longest path in a binary tree contained exactly four nodes, what is the maximum number of nodes that could be in that entier tree?
    • A. 

      31

    • B. 

      7

    • C. 

      15

    • D. 

      4

  • 5. 
    In a machine language, the technique in which the data to be manipulated by an instruction is included within the instruction itself is called…
    • A. 

      Direct adressing

    • B. 

      Indirect adressing

    • C. 

      Immediate addressing

  • 6. 
    Which of the following is a LIFO structure?
    • A. 

      Stack

    • B. 

      Queue

    • C. 

      Tree

    • D. 

      Array

  • 7. 
    If the number of nodes in a binary tree is 2^n (where n is a positive integer), then the entire tree would contain at least
    • A. 

      2^n+1 -1 nodes

    • B. 

      2^n+1 nodes

    • C. 

      2^n+2 nodes

    • D. 

      2^2n nodes

  • 8. 
    The nodes in which of the trees below will be printed in alphabetical order by the following recursive procedure? procedure printTree (Tree)          if(Tree is not empty)              then (apply the procedure printTree to the left subtree of Tree;                      apply the procedure printTree to the right subtree of Tree;                      print the root node) Veldu eitt:
    • A. 

      A)

    • B. 

      B)

    • C. 

      C)

  • 9. 
    Which of the following is a FIFO Structure?
    • A. 

      Array

    • B. 

      Queue

    • C. 

      Stack

    • D. 

      Tree

  • 10. 
    If a stack contained the entries w,x, y, z (from top to bottom), which of the following would be the contents after two enteries were removed and the the entry r was inserted?
    • A. 

      R, y, z

    • B. 

      R, w, x

    • C. 

      W, x, r

    • D. 

      Y, z, r

  • 11. 
    • A. 

      A.

    • B. 

      B.

    • C. 

      C.

    • D. 

      None of the above

  • 12. 
    Which of the following is not used when determining the location of an entry in a two-dimentional homogeneous array stored in row-major orderd?
    • A. 

      Number of rows in the array

    • B. 

      Number of columns in the array

    • C. 

      Indices

    • D. 

      Address polynomial