Skip to content

Category Archives: Python Programs

Given an unsorted array of integers, sort the array into a wave like array. An array ‘arr[0..n-1]’ is sorted in wave form if arr[0] >=… Read More
Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples:   Input: arr[]… Read More
Given a singly linked list L0 -> L1 -> … -> Ln-1 -> Ln. Rearrange the nodes in the list so that the new formed… Read More
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? (eg given s1 = ABCD… Read More
Given a Singly Linked List, write a function to delete a given node. Your function must follow following constraints: 1) It must accept a pointer to… Read More
In this article, we will print a dictionary of list values. Dictionary of list values means a dictionary  contains values as a list of dictionaries… Read More
In this article, we will convert a list of the named tuples to dictionaries using python. By using dict() method we can convert a list… Read More
Given a dictionary of list d, the task is to write a Python program to write a dictionary into a CSV file. The idea to… Read More
Following is a typical recursive implementation of QuickSort for arrays. The implementation uses last element as pivot.  Python3 """A typical recursive implementation of Quicksort for… Read More
In this article, we will discuss how to check if a set contains an element in python. Method: 1 Using in operator This is an… Read More
In this article, we will discuss how to get a list of values from a dictionary using Python. Method 1 : Using list() function We… Read More
Given a singly linked list and a position, delete a linked list node at the given position. Example:   Input: position = 1, Linked List =… Read More
Given a list, the task is to write a Python Program to get the indices of all occurrences of an element in a list. Method… Read More
The lambda function is an anonymous function. It can have any number of arguments but it can only have one expression. Syntax lambda arguments :… Read More
Given two sorted singly linked lists having n and m elements each, merge them using constant space. First, n smallest elements in both the lists… Read More

Start Your Coding Journey Now!