Python Program to Solve Josephus Problem using Linked List

This is a Python program to solve the Josephus problem using a linked list. Problem Description The program uses a circular single linked list to solve the Josephus problem. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variable head. 3. The variable head … Read more

advertisement

Python Program to Print Nth Node from the last of a Linked List

This is a Python program to print the Nth node from the end of a linked list. Problem Description The program creates a linked list and prints the Nth node from the end of the list. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with … Read more

advertisement

Python Program to Modify the Linked List such that All Even Numbers appear before all the Odd Numbers in the Modified Linked List

This is a Python program to move all even numbers before all the odd numbers in a linked list. Problem Description The program creates a linked list and modifies the linked list so that all even numbers appear before all the odd numbers in the list. Problem Solution 1. Create a class Node with instance … Read more

advertisement

Python Program to Interchange two Elements of the List without touching the Key Field

This is a Python program to interchange two nodes in a linked list. Problem Description The program creates a single linked list and allows the user to interchange two nodes in the list. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variables head … Read more

advertisement

Python Program to Interchange the two Adjacent Nodes given a circular Linked List

This is a Python program to interchange two adjacent nodes of a circular linked list. Problem Description The program creates a circular single linked list and allows the user to interchange two adjacent nodes in the list. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class CircularLinkedList … Read more

advertisement

Python Program to Find Intersection & Union of 2 Linked Lists

This is a Python program to find the union and intersection of two linked lists. Problem Description The program creates two linked lists and finds their union and intersection. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variable head. 3. The variable head … Read more

advertisement

Python Program to Convert a given Singly Linked List to a Circular List

This is a Python program to convert a given singly linked list to a circular list. Problem Description The program creates a singly linked list and converts it into a circular list. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variables head and … Read more

advertisement

Python Program to Reverse only First N Elements of a Linked List

This is a Python program to reverse the first N elements of a linked list. Problem Description The program creates a linked list and reverses its first N elements. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variables head and last_node. 3. The … Read more

advertisement

Python Program to Reverse a Linked List

This is a Python program to reverse a linked list. Problem Description The program creates a linked list and reverses it. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variables head and last_node. 3. The variable head points to the first element in … Read more

advertisement

Python Program to Remove Duplicates from a Linked List

This is a Python program to remove duplicates from a linked list. Problem Description The program creates a linked list and removes duplicates from it. Problem Solution 1. Create a class Node with instance variables data and next. 2. Create a class LinkedList with instance variables head and last_node. 3. The variable head points to … Read more

advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter