/ data structure ---- linked list-3 C/C++ language #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std ; int main ( ) { typedef struct list_node * list_pointer ; typedef struct list_node { int data ; list_pointer link ; } listNode ; // declare variables list_pointer first,second,third,temp ; first = ( list_pointer ) malloc ( sizeof ( listNode ) ) ; second = ( list_pointer ) malloc ( sizeof ( listNode ) ) ; third = ( list_pointer ) malloc ( sizeof ( listNode ) ) ; temp = ( list_pointer ) malloc ( sizeof ( listNode ) ) ; // data first - > data = 10 ; second - > data = 20 ; temp - > data = 30 ; third - > data = ...
留言
張貼留言