const char *
) and bool operator<(const char *, const char *) const;
bool operator==(const char *, const char *) const;
Each call is represented by an object of class Call.
class Call overloads read-only boolean comparison operators
==, < > <= and >= (comparisons are done by the telephone
number which initiated the call). To get the originating
phone number, use method
double getPhone#()
const;
(a 10-digit phone number can overflow int and unsigned).
You are given three very large arrays of objects of class Call
(sorted by initiating numbers), that represent all calls
made over the weekend (named weekend
), on weekdays after
business hours (named evening
)
and 9am-5pm on weekdays (named business
).
To evaluate a new calling plan for AZ&Z, you need to count unique telephone numbers from which calls initiated over the weekend or on weekdays after business hours, but never initiated a call 9am-5pm on weekdays.
Write a function that will print the total count of those
unique telephone numbers. That function should take the three arrays
as arguments and should return a similar array which contains the
numbers specified. You may assume that each of the arrays use a
record with the number 0000000000
as a marker for the last
record. The array you return should also have such an end marker. You
may further assume that the array you generate will have no more than
N phone numbers (where N is a global).
The code you write for this part should be able to be compiled under
g++. That is, we want exact C++ syntax.
You cannot use STL for this question
1 5 9 2 10 6 8 3 7 4 1 5 2 9 6 8 3 7 4 10 1 2 5 6 8 3 7 4 9 10 1 2 5 6 3 7 4 8 9 10 1 2 5 3 6 4 7 8 9 10 1 2 3 5 4 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
struct ListNode { double value; ListNode * next;
};
const ListNode * ptr1, * ptr2;
You need to write a self-contained program (no calls to STL) to construct a new circular list containing each element of the first list and each element of the second list. The order of elements from the first list should be the same as in the first list, and the order of the elements from the second list should be reversed. The program must work in linear time and use only a linear amount of additional memory. All other details are up to you.