Deck 13: Dynamic Data Structures
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/49
العب
ملء الشاشة (f)
Deck 13: Dynamic Data Structures
1
Using an array of structures to insert and delete ordered structures is an efficient use of memory.
False
2
A linked list provides a convenient method for maintaining a constantly changing list without the need to reorder and restructure the complete list continually.
True
3
Removal of a structure from an ordered linked list is the reverse process of adding a structure.
True
4
Each structure in a linked list has the same format.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
5
In addition to an end-of-list sentinel value in a linked list, we must provide a special pointer for storing the address of the last structure in the list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
6
C does not allow pointers to be members of structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
7
The dot operator has a lower precedence than the indirection operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
8
The precedence of the member operator and the structure pointer operator are equal.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
9
The member operator is evaluated from right to left.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
10
The structure pointer operator is evaluated from left to right.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
11
The addresses in a linked list of structures can be used to loop through the complete list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
12
C provides the four functions, malloc(), calloc(), realloc(), and free() to control the dynamic allocation and release of memory space.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
13
The function prototype for malloc() is contained in the stdio.h header file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
14
malloc() returns the address of the first reserved location, as an address of a void data type, or the program exits if sufficient memory is not available.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
15
The advantage to the calloc() function is that it initializes all newly allocated numeric memory to 0 and character allocated memory to NULL.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
16
In making requests for dynamic memory allocation, it is extremely important to always check the return value; otherwise, the program will crash when a subsequent access to nonexistent memory is made.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
17
You should never forget to restore the allocated block of storage back to the operating system using free(); otherwise, the allocated storage will be lost until you reboot the computer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
18
In computer programming, stacks are used in all function calls to store and retrieve data input to and retrieved from the function, respectively.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
19
A stack requires a separate stack pointer that contains the address of the first structure added to the stack.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
20
Items are removed from a queue in the order in which they were entered.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
21
A queue is a LIFO structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
22
The operation of removing an item from a queue is formally referred to as serving.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
23
The functions isempty() and isfull()are required in any queue implementation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
24
A dynamically linked list permits adding or deleting a structure from anywhere within the list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
25
Deleting a structure in a linked list is essentially the reverse process of inserting a structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
26
____ memory allocation makes it unnecessary to reserve a fixed amount of memory for a scalar, array, or structure variable in advance.
A)Dynamic
B)Static
C)Partial
D)Advanced
A)Dynamic
B)Static
C)Partial
D)Advanced
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
27
Dynamic memory allocation is also known as ____ allocation.
A)partial
B)static
C)run-time
D)advanced
A)partial
B)static
C)run-time
D)advanced
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
28
Structures that are "linked" together by including the address of the next structure in the structure immediately preceding it are known as ____ structures.
A)linked
B)self-referencing
C)dynamic
D)sequential
A)linked
B)self-referencing
C)dynamic
D)sequential
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
29
All programming languages that support pointers provide a special pointer value, known as both NULL and ____, that acts as a sentinel or flag to indicate when the last structure has been processed.
A)FALSE
B)VOID
C)NIL
D)INVALID
A)FALSE
B)VOID
C)NIL
D)INVALID
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
30
In C, the special NULL pointer value that acts as a sentinel or flag to indicate when the last structure has been processed has a numerical value of ____.
A)-1
B)0
C)1
D)255
A)-1
B)0
C)1
D)255
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
31
The indirection operator in C is ____.
A))
B)->
C)&
D)*
A))
B)->
C)&
D)*
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
32
The expression *emp.ptPay is equivalent to the expression ____.
A)*(emp.ptPay)
B)(*emp).ptPay
C)*emp->ptPay
D)*(emp.)ptPay
A)*(emp.ptPay)
B)(*emp).ptPay
C)*emp->ptPay
D)*(emp.)ptPay
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
33
Which of the following statements is correct with respect to the TeleType structure declaration?
Struct TeleType
{
Char name[30];
Char phoneNum[15];
Struct TeleType *nextaddr;
};
A)It is not valid in C
B)Can be used to create a linked list of TeleType structures
C)May be valid depending on the compiler
D)Generates a "self-referencing" compiler warning
Struct TeleType
{
Char name[30];
Char phoneNum[15];
Struct TeleType *nextaddr;
};
A)It is not valid in C
B)Can be used to create a linked list of TeleType structures
C)May be valid depending on the compiler
D)Generates a "self-referencing" compiler warning
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
34
The following is an example of the creation of a(n) ____ in C.
First = &t1;
T1)nextaddr = &t2;
T2)nextaddr = &t3;
T3)nextaddr = NULL;
A)array
B)stack
C)linked list
D)queue
First = &t1;
T1)nextaddr = &t2;
T2)nextaddr = &t3;
T3)nextaddr = NULL;
A)array
B)stack
C)linked list
D)queue
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
35
The structure pointer operator is ____.
A))
B)->
C)&
D)*
A))
B)->
C)&
D)*
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
36
The expression t1.nextaddr->name is evaluated as ____.
A)t1(.nextaddr->name)
B)(t1.nextaddr->)name
C)t1.(nextaddr->name)
D)(t1.nextaddr)->name
A)t1(.nextaddr->name)
B)(t1.nextaddr->)name
C)t1.(nextaddr->name)
D)(t1.nextaddr)->name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
37
The expression t1.nextaddr->name can be replaced by the equivalent expression ____.
A)(*t1.nextaddr).name
B)(&t1.nextaddr).name
C)*(*t1.nextaddr).name
D)*((*t1.nextaddr).name)
A)(*t1.nextaddr).name
B)(&t1.nextaddr).name
C)*(*t1.nextaddr).name
D)*((*t1.nextaddr).name)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
38
The following function cycles through a linked list and displays its contents. Line 3 can be replaced with ____.
1 void display(struct myStruct *contents)
2 {
3 while (contents != NULL)
4 {
5 printf("%-30s\n",contents->name, contents->phoneNum);
6 contents = contents->nextaddr;
7 }
8 }
A)while (isValid(contents))
B)while (contents != EOF)
C)while (!contents)
D)while (contents != NIL)
1 void display(struct myStruct *contents)
2 {
3 while (contents != NULL)
4 {
5 printf("%-30s\n",contents->name, contents->phoneNum);
6 contents = contents->nextaddr;
7 }
8 }
A)while (isValid(contents))
B)while (contents != EOF)
C)while (!contents)
D)while (contents != NIL)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
39
____ reserves the number of bytes requested by the argument passed to the function.
A)malloc()
B)calloc()
C)realloc()
D)balloc()
A)malloc()
B)calloc()
C)realloc()
D)balloc()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
40
____ reserves space for an array of n elements of the specified size.
A)malloc()
B)calloc()
C)realloc()
D)nalloc()
A)malloc()
B)calloc()
C)realloc()
D)nalloc()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
41
____ changes the size of previously allocated memory to a new size.
A)malloc()
B)calloc()
C)realloc()
D)free()
A)malloc()
B)calloc()
C)realloc()
D)free()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
42
The function call ____ requests enough memory to store 10 characters.
A)realloc(10,sizeof(char))
B)calloc(sizeof(char),10)
C)malloc(sizeof(char))
D)malloc(10 sizeof(char))
A)realloc(10,sizeof(char))
B)calloc(sizeof(char),10)
C)malloc(sizeof(char))
D)malloc(10 sizeof(char))
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
43
A ____ is a special type of linked list in which objects can only be added to and removed from the top of the list.
A)heap
B)stack
C)queue
D)set
A)heap
B)stack
C)queue
D)set
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
44
The operation of placing a new structure on the top of a stack is called a ____.
A)PUSH
B)POP
C)INSERT
D)PUT
A)PUSH
B)POP
C)INSERT
D)PUT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
45
Stacks and queues are two special forms of a more general data object called a(n) ____.
A)array
B)table
C)deque
D)heap
A)array
B)table
C)deque
D)heap
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
46
The following pseudocode describes a stack's ____ function.
Move the structure contents pointed to by the top-of-stack pointer into a work area
Free the structure pointed to by the top-of-stack pointer
Move the address in the work area address field into the top-of-stack pointer
A)PUSH
B)POP
C)ISEMPTY
D)NEW
Move the structure contents pointed to by the top-of-stack pointer into a work area
Free the structure pointed to by the top-of-stack pointer
Move the address in the work area address field into the top-of-stack pointer
A)PUSH
B)POP
C)ISEMPTY
D)NEW
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
47
Placing a new item on top of the queue is formally referred to as ____.
A)enqueueing
B)serving
C)pushing
D)inserting
A)enqueueing
B)serving
C)pushing
D)inserting
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
48
The operation of adding a new structure to a dynamically linked list is called a(n) ____.
A) PUSH
C) INSERT
B) ENQUEUE
D) ADD
A) PUSH
C) INSERT
B) ENQUEUE
D) ADD
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
49
The operation of removing a structure from a dynamically linked list is called a(n) ____.
A) POP
C) REMOVE
B) SERVE
D) DELETE
A) POP
C) REMOVE
B) SERVE
D) DELETE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck