chtp5_12-TIF-Beta - 12.1Introduction 12.1. _ are...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
12.1 Introduction 12.1. __________ are collections of data items “lined up in a row”—insertions and deletions are made anywhere in a __________[same]. a) Linked lists b) Queues c) Stacks d) Binary trees ANS: (a) 12.2. __________ are important in compilers and operating systems—insertions and deletions are made only at one end of a __________[same]--its top. a) Linked lists b) Queues c) Stacks d) Binary trees ANS: (c) 12.3. __________ represent waiting lines; insertions are made at the back (also called the tail) and deletions are made from the front (also called the head) of a __________ [same]. a) Linked lists b) Queues c) Stacks d) Binary trees ANS: (b) 12.4. __________ facilitate high-speed searching and sorting of data, efficient elimination of duplicate items and compiling expressions into machine language. a) Linked lists b) Queues c) Stacks d) Binary Trees ANS: (d) 12.2 Self-Referential Structures 12.5 A self-referential structure contains a ________ member that points to ________. (a) integer, a structure of the same structure type (b) pointer, an integer (c) integer, an integer (d) pointer, a structure of the same structure type ANS: (d) 12.6. A __________ structure contains a pointer member that points to a structure of the same structure type (choose the most correct term). a) Self-dynamic b) Self-replicating c) Self-pointing d) Self-referential ANS: (d) 12.7. A(n) __________ pointer normally indicates the end of a data structure. a) uninitialized b) NULL
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
c) self d) dereferenced ANS: (b) 12.3 Dynamic Memory Allocation 12.8 A __________ occurs when dynamically allocated memory is not returned when it is no longer needed. (a) memory leak (b) self-referential error (c) allocation error (d) sizeof error ANS: (a) 12.9 Function malloc returns a pointer of type ________. (a) malloc (b) int (c) void (d) none of these ANS: (c) 12.10. __________ memory allocation is the ability for a program to obtain more memory space at execution time to hold new nodes and to release space no longer needed. a) Static b) Active c) Selective d) Dynamic ANS: (d) 12.11. Function malloc takes as an argument the number of bytes to be allocated, and returns a pointer of type __________ to the allocated memory. a) NULL b) void c) void * d) NULL * ANS: (c) 12.12. If no memory is available malloc returns a __________ pointer. a) self b) NULL c) void d) NULL * ANS: (b) 12.13. Which of the following statements is true? a) A structure’s size is sometimes smaller than the total of the sizes of its members. b) A structure’s size is always larger than the total of the sizes of its members. c) A structure’s size is not necessarily the sum of the sizes of its members. d) A structure’s size is the sum of the sizes of its members.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

chtp5_12-TIF-Beta - 12.1Introduction 12.1. _ are...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online