educative.io

Are linked linked implemented with only classes in Python?

I am a CPP Developer. I have been facing problems implementing inked lists but is this the only way or there is a way by allocating memory and adjoining nodes

Hi @Mohammad_Alim,
Python does not have any implementation of pointers as in CPP, so it is not possible to allocate a memory address of a node to next. The simplest method of implementing a linked list in Python is to store a node object in the next portion of each node.