CS C++ Quiz 11(old 8) Which of the following statements is true of these defined variables? int *a, b, c; (a) Variables a, b, and c are all integers. (b) Variables a, b, and c are all pointers to integers. (c) Variable a is an integer; variables b and c are pointers to integers. (d) Variable a is a pointer to an integer; variables b and c are integers. Which of the following code segments correctly defines variable p to be a pointer to the integer value 5? (a) int p = 5; (b) int *p = 5; (c) int *p; *p = 5; (d) int *p = new int; *p = 5; (e) int *p = new int; p = 5; Consider the following definitions and code segment: char *p, *q, ch; p = new char; ch = 'x'; *p = ch; q = p; Which of the following diagrams best illustrates the values of variables p, q and ch after the code segment is executed? (a) (b) (c) (d) (e) Assume that variables x, p and q are defined as follows: int x = 10; int *p, *q; Which of the following code segments includes a dereference of an uninitialized pointer? (a) *p = x; q = p; (b) p = NULL; q = p; (c) p = new int; q = p; *q = 30; (d) p = new int; *p = x; (e) p = new int; delete p; Assume that a type ListItem has been defined to be used to represent some kind of linked list of integers. Consider the following function, which is intended to determine whether the value k is in the list pointed to by L: bool ListMember(ListItem *L, int k) { while (L != NULL) { if (L-next; } return false; } For which of the following kinds of linked lists will function ListMember work correctly? I. singly-linked list II. doubly-linked list III. doubly-linked circular list (a) I only (b) II only (c) III only (d) I and II (e) II and III Write a function which, given a pointer to the first element in a linked list of unsorted integer values, returns the largest integer occurring in the list. Use the following prototype: int LargestInteger(ListItem *listPtr) // Precondition: // listPtr is either NULL, or a pointer to an element in a list // Postcondition: // Returns the largest integer occurring in the list headed by listPtr