C++ InsertHead
program to create a linked list of integers and insert an element
to the head of the linked list. Multiple elements can be
inserted several times UNTIL a 0 is received.
#include <iostream>
typedef int ElemType;
typedef struct LNode {
ElemType data;
struct LNode* next;
}LNode, *linkedList;
void showList(linkedList l) {
while (NULL != l) {
printf("%d\n", l->data);
l = l->next;
}
}
C++ InsertHead program to create a linked list of integers and insert an element to the head of the linked list. Multip
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am