Just like we traverse a python dictionary, a list or tuple to access its elements, We can also traverse binary trees to access their elements. There … [Read more...] about Level Order Tree Traversal in Python
Convert a Dictionary to List of Tuples in Python
We know that a dictionary in python contains key-value pairs. In this article, we will convert a python dictionary to a list of tuples where each … [Read more...] about Convert a Dictionary to List of Tuples in Python
In-order Tree Traversal in Python
You might have studied algorithms to traverse a python dictionary, a list, or a tuple. In this article, we will study the in-order traversal algorithm … [Read more...] about In-order Tree Traversal in Python
Tree Data Structure in Python
Python is a very rich language in terms of features and data structures. It has a lot of inbuilt data structures like Python dictionary, list, tuple, … [Read more...] about Tree Data Structure in Python
Check If a List has Duplicate Elements
Lists are the most used data structures in Python. While programming, you may land into a situation where you will need a list containing only unique … [Read more...] about Check If a List has Duplicate Elements
Binary Search Tree in Python
You can use different data structures such as a python dictionary, a list, a tuple, or a set in programs. But these data structures are not sufficient … [Read more...] about Binary Search Tree in Python
How to modify a tuple in Python
We know that tuple is an immutable data type unlike a python dictionary or a list. That means, we cannot modify a tuple by any means. But, We may need … [Read more...] about How to modify a tuple in Python
How to add an Element to a Set in Python
Sets in python are used to store unique elements or objects. Unlike other data structures like tuples or lists, sets do not allow adding duplicate … [Read more...] about How to add an Element to a Set in Python
Find the index of an element in a list
Searching for all the occurrences of an element in a list can be a tedious task. In this article, we will try to find the index of an element in a … [Read more...] about Find the index of an element in a list
Count the Frequency of Elements in a List
Many times, we need to perform quantitative analysis of data in python. In this article, we will look at some ways to count the frequency of elements … [Read more...] about Count the Frequency of Elements in a List