click below
click below
Normal Size Small Size show me how
Stack #3867195
| Question | Answer |
|---|---|
| Character is a primitive data structure. | True |
| A Tree is unordered lists which use a ‘hash function’ to insert and search. | False |
| 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: ADTs support abstraction, encapsulation, and information binding. | False |
| Given: int *q; * q = 10; The statement cout << *q will have an output of 10. | True |
| char &ch is valid pointer declaration | False |
| It is a memory address of a variable. | Pointer |
| If pointer variable pointing to the dynamic variable that was destroyed and becomes undefined is called dangling pointers. | True |
| A linked list is variable in size. | True |
| Queue adds anywhere, removes the highest priority | False |
| Abstraction is providing only essential information outside the world. | True |
| The new operator creates a new dynamic variable of a specified type and returns a pointer that points to this new variable. | 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. |
| Graphs & Trees are non-linear lists. | True |
| Pointer Variable is the content that is stored in the memory address. | False |
| If there is insufficient available memory to create the new variable, then new returned a special value named NIL. | False |
| In many programming languages, including C and C++, it is possible to pass a struct ( | True |
| TRUE/FALSE: Program = Algorithms + Data Structures | True |
| The following are examples of primitive data structures, except. | Integer Character Float (Array) |
| True/False: Abstract Data Type (ADT) stores data and allow various operations on the data to access and change it. | True |
| Given: int *p; int x; x = 10; p = x is a valid statement. | False |
| You can assign a name definition and then use the type name to declare variables using typedef keyword. | True |
| Pointers can be used as parameter to accept an array from outside. | True |
| cout << list.back() << endl; The back member function returns a reference to the last element in the list. | 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 |
| What is the value of TOP when the STATIC STACK is FULL? | = to the (stack size-1) |
| What happens to the value of the TOP during a PUSH operation in a STATIC STACK? | increments by 1 |
| In a DYNAMIC STACK the pointer TOP stays at the HEAD after a PUSH operation. | False |
| In a dynamic stack, the pointer TOP is like the HEAD which always point to the first element of the linked list. | True |
| In a DYNAMIC STACK the pointer TOP stays at the HEAD after a PUSH operation. | False |
| In a dynamic implementation of stack, the pointer TOP has an initial value of NULL. | True |
| Below is a valid declaration of a dynamic stack implemented as a list: stack< int, list<int> > iStack; | True |
| The STL function push retrieves an element at the top of the stack. | False |
| Below is a valid declaration of a dynamic stack implemented as a vector: stack< int > iStack | False |
| In inserting a node, finding its proper location and following a certain order is necessary. | 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 |
| The algorithm for displaying the elements of a linked list would require traversal. | True |
| cout << list.front() << endl; front returns a reference to the last element of the list. | False |
| The following are stack operations except: | IsEmpty Push Pop (Clear) |
| The initial value of index top in the static implementation of a stack is 0. | False |
| Pop function will always retrieve the top. | True |
| The STL stack container may be implemented as a vector, a list, or a deque. | True |
| Below is a valid declaration of a dynamic stack implemented as a vector: stack< int > iStack | False |
| Appending a node means adding a node at the start of the list. | False |
| list.unique(); unique removes any element that has the same value as the element | True |
| The STL list function push_back is equivalent to inserting a node in a list. | False |
| Which of the following is an application of a stack? | Sending of Network Packets CPU Scheduling Printer Spooler (Calculator) |
| The manner in which a stack behaves? | LIFO |
| Dynamic Stacks can be implemented using linked list. | True |
| In a static stack, the variable stackSize will handle the total capacity of the stack. | True |
| A stack container that is used to adapt to different containers, it is often referred to as a container adapter. | True |
| The delete operation only involves the removing of the node from the list without breaking the links created by the next pointers. | False |
| You need an array to represent each node in a linked list. | False |
| In inserting a node, finding its proper location and following a certain order is necessary. | True |
| Use of template will make the ADT flexible in terms of accepting values of different data types. | 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 |
| In a dynamic stack, pointer TOP points to a fixed value in the linked list and does not move. | False |