click below
click below
Normal Size Small Size show me how
DATA STRUCT MOD 1&2
| Question | Answer |
|---|---|
| Heap is a special area of memory that is reserved for dynamically allocated variables. | True |
| Pointer is a non-primitive data structure. | False |
| Character is a primitive data structure. | True |
| The new operator eliminates a dynamic variable and returns the memory that the dynamic variable occupied to the freestore manager so that the memory can be reused. | False |
| True/False: The & in front of an ordinary variable produces the address of that variable; that is, it produces a pointer that points to the variable. | True |
| Given: int *p, *q; int x, y; x = 2; y = 7; p = &y; q = p; The statment cout << *q will have an output of memory address. | False |
| TRUE/FALSE: There is a name associated with a pointer data type in C++. | False |
| Remove operator eliminates a dynamic variable and returns the memory that the dynamic variable occupied to the freestore manager so that the memory can be reused. | False |
| Stack is a special area of memory that is reserved for dynamically allocated variables. | False |
| Appending a node means adding a node at the start of the list. | False |
| The STL list function push_back is equivalent to inserting a node in a list. | False |
| A circular linked list has 2 node pointers. | False |
| cout << list.back() << endl; The back member function returns a reference to the last element in the list. | True |
| A doubly linked list has both a next and previous node pointers. | True |
| The following are characteristics of non-primitive data types, except: | The non-primitive data structures emphasize on structuring of a group of homogeneous data items only. |
| Primitive data structures are derived from non-primitive data structures. | False |
| It is is a step by step procedure to solve a particular function. | Algorithm |
| An ADT is a relational model, together with the various operations defined on the model. | False should be conceptual |
| Abstraction is providing only essential information outside the world. | True |
| It is a memory address of a variable. | Pointer |
| The address of operator is a unary operator that returns the address of its operand. | & |
| TRUE/FALSE: The * operator in front of a pointer variable produces the variable to which it points. When used this way, the * operator is called the dereferencing operator. | True |
| When you apply delete to a pointer variable, the dynamic variable to which it is pointing is destroyed. | True |
| Pointers can be used as parameter to accept an array from outside. | True |
| This node is responsible to handle the data that will be added to the linked list. | newNode |
| In addition to the data, each node contains a pointer, which can point to another node. | True |
| The list container, found in the Standard Template Library, is a template version of a doubly linked list. | True |
| list [int] myList; // is a valid declaration | False |
| cout << list.back() << endl; The back member function returns a reference to the last element in the list. | True |
| It is is representation of the logical relationship existing between individual elements of data. | Data Structure |
| You can assign a name definition and then use the type name to declare variables using typedef keyword. | True |
| Given: int *q; * q = 10; The statement cout << *q will have an output of 10. | True |
| In the declaration, int *p, q, only p is a pointer variable. | True |
| This operation means to add the node to the end of the list. | Append |
| list.unique(); unique removes any element that has the same value as the element | True |
| STL lists are also efficient at adding elements at their back because they have a built-in pointer to the last element in the list. | True |
| Array is an example of homogeneous data structures. | True |
| TRUE/FALSE: Program = Algorithms + Data Structures | True |
| Dynamic Array Is an array whose size is not specified when you write the program, but is determined while the program is running. | True |
| True/False: Abstract Data Type (ADT) stores data and allow various operations on the data to access and change it. | True |
| TRUE/FALSE: The * operator in front of a pointer variable produces the variable to which it points. When used this way, the * operator is called the dereferencing operator. | True |
| Given: int *p; int x; x = 10; p = x is a valid statement. | False |
| The new operator creates a new dynamic variable of a specified type and returns a pointer that points to this new variable. | True |
| Any new dynamic variable created by a program consumes some of the memory in the freespace | False |
| TRUE/FALSE: Each node in a linked list contains one or more members that represent data and a pointer which can point to another node. | True |
| Use of template will make the ADT flexible in terms of accepting values of different data types. | True |
| The following are examples of non-linear list, except: | Stack |
| Pointer Variable is the content that is stored in the memory address. | False |
| When you apply delete to a pointer variable, the dynamic variable to which it is pointing is destroyed. | True |
| The delete operation only involves the removing of the node from the list without breaking the links created by the next pointers. | False |
| A linked list is variable in size. | True |
| True/False: ADTs support abstraction, encapsulation, and information binding. | True |
| A linked list can grow or shrink in size as the program runs. | True |
| char &ch is valid pointer declaration | False |
| In inserting a node, finding its proper location and following a certain order is necessary. | True |