click below
click below
Normal Size Small Size show me how
DSA FA1
DATA STRUCUTRES AND ALGORITHMS FORMATIVE ASSESSMENT 1
| Question | Answer |
|---|---|
| Stack is a special area of memory that is reserved for dynamically allocated variables. True False | False |
| If pointer variable pointing to the dynamic variable that was destroyed and becomes undefined is called dangling pointers. True False | True |
| Appending a node means adding a node at the start of the list. True False | False |
| 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 False | True |
| list [int] myList; // is a valid declaration True False | False |
| A doubly linked list has both a next and previous node pointers. True False | True |
| list.unique(); unique removes any element that has the same value as the element True False | True |
| A Tree is unordered lists which use a ‘hash function’ to insert and search. True False | False |
| Character is a primitive data structure. True False | True |
| TRUE/FALSE: Program = Algorithms + Data Structures True False | True |
| True/False: ADTs support abstraction, encapsulation, and information binding. True False | True |
| TRUE/FALSE: Refer to ADT: The ADT is DYNAMIC. True False | 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 False | True |
| 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. False True | True |
| Given: int *q; * q = 10; The statement cout << *q will have an output of 10. True False | False |
| 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. They are more sophisticated data types. | The non-primitive data structures emphasize on structuring of a group of homogeneous data items only. |
| You can assign a name definition and then use the type name to declare variables using typedef keyword. True False | True |
| Heap is a special area of memory that is reserved for dynamically allocated variables. True False | True |
| Abstraction is providing only essential information outside the world. True False | True |
| Given: int *p; int x; x = 10; p = x is a valid statement. True False | False |
| Pointer Variable is the content that is stored in the memory address. True False | False |
| Pointers can be used as parameter to accept an array from outside. True False | True |
| Typedef is declared within the main program. True False | False |
| A circular linked list has 2 node pointers. True False | False |
| cout << list.front() << endl; front returns a reference to the last element of the list. True False | False |
| 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 False | True |
| Array is an example of homogeneous data structures. True False | True |
| The following are examples of primitive data structures, except. Integer Array Character Float | Array |
| Which of the following is the proper way of declaring a pointer variables of type char? char *p, *q; .*char p, q; &char p, q; .char &p, &q; | char *p, *q; |
| TRUE/FALSE: There is a name associated with a pointer data type in C++. True False | True |
| You said: This node is responsible to handle the data that will be added to the linked list. nodePtr newNode previous head | newNode |
| A linked list can grow or shrink in size as the program runs. True False | True |
| The list container, found in the Standard Template Library, is a template version of a doubly linked list. True False | True |
| Use of template will make the ADT flexible in terms of accepting values of different data types. True False | True |
| It is is a step by step procedure to solve a particular function. Program Data Algorithm Process | Algorithm |
| Given: int *p, *q; int x, y; x = 2; y = 7; p = &y; q = p; The statement cout << *q will have an output of memory address. True False | False |
| It is a memory address of a variable. Address of a Variable Variable Pointer Pointer Variable | Address of a Variable |
| Any new dynamic variable created by a program consumes some of the memory in the freespace True False | True |
| In inserting a node, finding its proper location and following a certain order is necessary. True False | True |
| Queue adds anywhere, removes the highest priority True False | False |
| Abstraction means separating the logical properties from the implementation details. True False | True |
| char &ch is valid pointer declaration True False | False |
| The new operator creates a new dynamic variable of a specified type and returns a pointer that points to this new variable. True False | True |
| 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 False | True |
| A linked list is a series of connected nodes, where each node is a data structure. True False | True |
| cout << list.front() << endl;front returns a reference to the last element of the list. True False | 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. True False | True |
| You need an array to represent each node in a linked list. True False | False |
| Insertion and deletion of nodes is quicker with linked lists than with vectors. True False | True |
| An ADT is a relational model, together with the various operations defined on the model. True False | False |
| The STL list function push_back is equivalent to inserting a node in a list. True False | True |
| Pointer is a non-primitive data structure. True False | False |