CS_8251 - Unit 4 - Structures

UNIT IV STRUCTURES 9 Structure - Nested structures – Pointer and Structures – Array of structures – Example Program using structures and pointers – Self referential structures – Dynamic memory allocation - Example Program: Singly linked list and concept- typedef

4 flashcards · Programming Languages · by kgashok

  1. What is the keyword for defining a structure in C?

    struct

  2. Q-1: What would happen if you lose the head of a singularly-linked linked list? A. If you lose the head, the next node becomes the head. B. If you lose the head, the list is still in memory, you just cannot find it. C. It is impossible to lose the head. D. If you lose the head, you lose access to the entire linked list.

    Choice B and Choice D.

  3. Q-2: True / false: The while loop is needed to keep the traversal from going past the end of the list. A. True B. False

    Choice A. True.

  4. Q-3: Select the correct statement below. A. Every Node is contained within the LinkedList object. Making access to every Node of the linked list possible. B. Every Node in the linked list is exactly one space in memory away from the next. This makes it possible to find the next Node and traverse through the list. C. Every Node in the list is in various locations in memory, and those memory addresses are stored in an array inside of the LinkedList object, which makes accessing each Node possible…

    Choice D. D. Every Node in the list is in various locations in memory, and each Node contains a pointer to the next Node in the list without needing to be contained in the LinkedList object.