DEV Community

Cover image for Implementation of Linked Lists in C++ and Python

Implementation of Linked Lists in C++ and Python

Md Mahfuz Hossain on February 20, 2024

Hi everyone, I'm Mahfuz Hossain, a student of Information and Communication Engineering from Bangladesh. In this article, I'm going to talk about L...
Collapse
 
pauljlucas profile image
Paul J. Lucas

You should have an actual slist class that contains the pointer to the head and a second pointer to the tail of the list to make appending an O(1) operation. Additionally, the class should be a template so you can have any type, not just int.

Collapse
 
mdmahfuzbipu profile image
Md Mahfuz Hossain

You are right. Basically I've just shown the simple implementation and printing part of the linked list for the beginners. It needs to be modified for insertion, deletion operations.