AmitDiwan has Published 10744 Articles

Python Program to Display the Nodes of a Linked List in Reverse without using Recursion

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 13:02:14

213 Views

When it is required to display the nodes of a linked list in reverse without using the method of recursion, a method to add elements to the linked list, and a method to display the elements in reverse order is defined.Below is a demonstration for the same −Example Live Democlass Node: ... Read More

Python Program to Display all the Nodes in a Linked List using Recursion

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:59:35

591 Views

When it is required to display the elements/nodes in a linked list, using recursion method, a method to add values to the linked list, and a method to print the elements of a Linked List. It would also have a helper method that uses recursion, i.e calls the helper function ... Read More

Python Program to Display the Nodes of a Linked List in Reverse using Recursion

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:57:08

170 Views

When it is required to display the elements/nodes in a linked list in reverse order, using recursion method, a method to add values to the linked list, as well as a method to reverse the elements of a Linked List. It would also have a helper method that uses recursion, ... Read More

Python Program to Search for an Element in the Linked List without using Recursion

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:53:42

524 Views

When it is required to search for an element in a linked list without using recursion method, a method to add values to the linked list, as well as a method to display the elements of a Linked List.It would also have a method that helps find the index of ... Read More

Python Program to Create a Linked List & Display the Elements in the List

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:51:06

1K+ Views

When it is required to create a linked list, and display the elements of this linked list, a method to add values to the linked list, as well as a method to display the elements of a Linked List.Below is a demonstration for the same −Example Live Democlass Node:    def ... Read More

Append Dictionary Keys and Values (In order ) in dictionary using Python

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:40:34

797 Views

When it is required to append the keys and values of a dictionary in order, the ‘list’ method can be used. Along with this, the ‘.keys’ and ‘.values’ method can be used access the specific keys and values of the dictionary.Below is a demonstration of the same −Example Live Demomy_dict = ... Read More

Convert key-values list to flat dictionary in Python

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:38:58

600 Views

When it is required to convert a dictionary, that contains pairs of key values into a flat list, dictionary comprehension can be used.It iterates through the dictionary and zips them using the ‘zip’ method.The zip method takes iterables, aggregates them into a tuple, and returns it as the result.Below is ... Read More

Extract tuples having K digit elements in Python

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:37:33

466 Views

When it is required to extract tuples that have a specific number of elements, list comprehension can be used. It iterates over the elements of the list of tuple and puts forth condition that needs to be fulfilled. This will filter out the specific elements and stores them in another ... Read More

Python program to convert Set into Tuple and Tuple into Set

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:35:03

764 Views

When it is required to convert a set structure into a tuple, and a tuple into a set, the ‘tuple’ and ‘set’ methods can be used.Below is a demonstration of the same −Example Live Demomy_set = {'ab', 'cd', 'ef', 'g', 'h', 's', 'v'} print("The type is : ") print(type(my_set), " ", ... Read More

Python Program to Take in a String and Replace Every Blank Space with Hyphen

AmitDiwan

AmitDiwan

Updated on 14-Apr-2021 12:33:35

1K+ Views

When it is required to take a string and replace every blank space with a hyphen, the ‘replace’ method can be used. It takes two parameters, the blank space, and the value with which it needs to be replaced (hyphen in this case).Below is a demonstration of the same −Example Live ... Read More

Advertisements