nerdexam
Microsoft

98-372 · Question #116

98-372 Question #116: Real Exam Question with Answer & Explanation

The correct answer is C. Stack. The Stack collection is a last-in, first-out collection. A stack is the Last in First Out (LIFO) abstract data type and data structure. It can have any abstract data type as an element. However, a stack is characterized by only two basic operations: push and pop. The push operati

Question

You are creating an application using .NET Framework 4.0. You need to use a last-in, first- out collection in the application. Which of the following is a last-in, first-out collection?

Options

  • AQueue
  • BList
  • CStack
  • DHash

Explanation

The Stack collection is a last-in, first-out collection. A stack is the Last in First Out (LIFO) abstract data type and data structure. It can have any abstract data type as an element. However, a stack is characterized by only two basic operations: push and pop. The push operation is used to add an item to the top of the stack, hiding any items already on the stack, or initializing the stack if it is empty. The pop operation is used to remove an item from the top of the stack, and returns this value to the caller. A pop either exposes previously hidden items or results in an empty stack. A stack is a restricted data structure, as only a limited number of operations are carried out on it. The nature of the pop and push operations also indicates that the stack elements have a natural order. The elements are removed from the stack in the reverse order to the order of their addition. Consequently, the lower elements are those that have been on the stack the longest. Answer: A is incorrect. The Queue class is a first-in, first-out collection. Answer: B is incorrect. The List class does not support ordered retrieval. Answer: D is incorrect. The Hash class offers evidence about the hash value for an assembly. The hash value signifies a distinct value that corresponds to a specific set of bytes. The hash value designates the assembly without ambiguity, instead of referring to the assembly by name, version, or other designation. Names are subject to collisions in exceptional cases where the identical name is specified to totally different code. Different variations of code can unintentionally be marked with the identical version. However, changing a single bit might result in a very different hash value. The Hash class cannot be inherited.

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice