Since any node points to a memory location is there any specific need in using it's pointer as structure type.Why couldn't we use integer as the pointer type in linked list rather than structure?
The nodes in a linked list need to hold two things:
- the node's value
- a (possibly null) pointer to the next node
That makes them structs, so a pointer to a node is a pointer to a struct.
You can use an untyped pointer if you wish, but the advantage of having a pointer to a structure is type safety – it helps you protect yourself from misusing the pointer. When implemented in machine code, the pointer is indeed untyped.
It's not a terribly good idea to implement a pointer as an integer, however, since the sizes of both are implementation dependent and could differ. On your system a particular type of integer has the same size as a pointer, but on another system that same type of integer has a different, perhaps smaller, size. Sometimes you even have to worry about several types of pointers.