1/48
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
The typedef statement allows you to change the item type easily.
True
The size_type type is used to track the number of items.
True
The value_type name must be used in all functions.
False
The insert function adds a new element to the bag.
True
The erase_one function removes all occurrences of a value.
False
The erase function removes all occurrences of a value.
True
The count function returns the number of occurrences of a given value.
True
The size function returns the number of items in the bag.
True
The CAPACITY constant can be changed by non-member functions.
False
Using 'using namespace std;' in header files is good practice.
False
The used variable tracks the number of elements in the bag.
True
Container classes cannot be reused with a different data type.
False
A bag object is a type of container class.
True
A container class stores a collection of items.
True
The new operator allocates memory from the heap.
True
The delete operator returns memory to the heap.
True
The bad_alloc exeption is thrown if new fails.
True
Pointer notation p→m is equivalent to (*p).m.
True
A pointer to a const int allows changing the value pointed to.
False
Passing a pointer by reference allows a function to modify the pointer itself.
True
Dynamic arrays require delete{} to free the memory.
True
Automatic assignment operators are safe for classes with dynamic memory.
False
A destructor is automatically called when an object goes out of scope.
True
Local objects with destructors are destroyed when their function returns.
True
Reference parameters with destructors are destroyed when the function returns.
False
Deleting dynamic objects call their destructor.
True
The reserve function expands the dynamic array capacity in a bag.
True
Returning a local object copies it to a return location.
True
The copy function in is used to copy dynamic arrays.
True.
A linked list is a sequence of nodes connected by pointers.
True
Each node contains data and a pointer to the next node.
True
The head_ptr points to the first node in the list.
True
The tail_ptr points to the last node in the list
True
An empty list has head_ptr equal to NULL.
True
A NULL pointer indicates a node does not point to anything.
True
The list_search function returns a pointer to the node containing the target value or NULL.
True
Inserting at the head adds a node before the first node.
True
Inserting after a node places the new node after the given node.
True
Deleting the first node requires moving head_ptr and deleting the old node.
True
Deleting after a node uses previous_ptr->get_next() and set_next().
True
Traversing a list is done using ptr = head_ptr; ptr != NULL; ptr = ptr->get_next().
True
head_ptr points to NULL after deleting the last node.
True
A linked list can contain multiple nodes with the same value.
True
A linked list node cannot contain a pointer to a previous node in a singly linked list.
True
The get_next() function returns a pointer to the next node.
True
The get_value() or get_data() function returns the data stored in a node.
True
A pointer to a node can be set to NULL to indicate the end of a list.
True
Traversing a list incorrectly can cause access to invalid memory.
True