18 Node * current = head;
19 while (current != NULL)
22 cout << current->
value <<
" -> ";
23 current = current->
next;
31 Node * current = head;
32 while (current != NULL)
35 cout << current->
value;
37 cout << setw(5) << setfill(
'0') << current->
value;
38 current = current->
next;
64 while ( head != NULL )
78 int newSize = size * 2;
81 char * tmp =
new char [ newSize ];
83 for (
int i = 0; i < size; ++i)
100 digits =
new char [arraysize];
108 if (numRead >= arraysize)
133 char * digits = NULL;
143 for (
int i = numDigits-1; i >=0; --i) {
144 str = digits[i] + str;
145 if (str.length()==5) {
146 val = atoi(str.c_str());
157 val = atoi(str.c_str());
163 if (digits != NULL) {
182 Node * current = head;
183 while (current != NULL)
187 current = current->
next;
203 else if (len1 < len2)
208 Node * curr1 = n1, * curr2 = n2;
210 while (curr1 != NULL) {
211 if (curr1->
value > curr2->value)
213 else if (curr1->
value < curr2->value)
243 cout <<
" is larger." << endl;
248 cout <<
" is not larger." << endl;
void grow_array(char *&array, int &size)
void delete_list(Node *&head)
void print_num(Node *head)
void delete_head(Node *&head)
int list_length(Node *head)
void head_insert(Node *&head, int v)
bool larger(Node *n1, Node *n2)
void print_list(Node *head)
void input_num(char *&digits, int &numDigits)