This program is a different approach over the same old singly linked list. Instead of creating a single structure and keeping the pointer of the next node of the same type as a member of the structure, I here used three different structures, and a plain long nextaddress
member in each to point the address of the next node, because pointers also do the same.
Each node also has a int flag
member as the first item of the structure, and the data
part resides at the end of the structure because of its variable length.
The three structures are basic extension of the built-in types, long
, double
and char
. While accessing the structures, I first casted the address of the node as an int *
, which gives me access to the flag
without fully typecasting the address to a definite structure from the three.
Then analyzing the flag
, various operations are done.
So here's my question. Can it be called a valid linked list? And moreover, is it even a valid data structure?