Skip to content

Latest commit

 

History

History
59 lines (50 loc) · 3.46 KB

File metadata and controls

59 lines (50 loc) · 3.46 KB

Lists:

Implement a function to sort a list of tuples based on the second element of each tuple.
Write a program to flatten a nested list.
Implement a function to find the kth smallest element in a list.
Write a Python program to rotate a list by a specified number of positions.
Implement a function to find the longest increasing subsequence in a list.
Write a program to shuffle a list randomly without using any built-in functions.
Implement a function to find all pairs of elements in a list that sum up to a specific target value.
Write a Python program to partition a list into two parts based on a predicate function.
Implement a function to compute the cumulative sum of elements in a list.
Write a program to generate all permutations of a list.

Tuples:

Implement a function to merge two sorted tuples into a single sorted tuple.
Write a Python program to check if two tuples are disjoint or not.
Implement a function to find the nth Fibonacci number using tuple unpacking.
Write a program to zip two tuples together and then unzip them.
Implement a function to find the mode (most frequent element) in a tuple.
Write a Python program to calculate the dot product of two tuples.
Implement a function to check if a tuple is a subsequence of another tuple.
Write a program to generate all possible combinations of elements from a tuple.
Implement a function to find the median of a tuple of numbers.
Write a Python program to remove duplicate elements from a tuple.

Sets:

Implement a function to find the intersection of multiple sets.
Write a program to find the power set of a given set.
Implement a function to check if a set is a subset of another set.
Write a Python program to compute the Cartesian product of two or more sets.
Implement a function to find the symmetric difference between two sets.
Write a program to generate all unique permutations of elements from a set.
Implement a function to check if two sets are disjoint or not.
Write a Python program to check if a given set forms a complete set or not.
Implement a function to check if a set is a proper subset of another set.
Write a program to perform set partitioning recursively.

Dictionaries:

Implement a function to merge two dictionaries, keeping values of common keys from the second dictionary.
Write a program to find the key with the maximum value in a dictionary.
Implement a function to sort a dictionary by its values in ascending order.
Write a Python program to find the frequency of each character in a string and store it in a dictionary.
Implement a function to flatten a dictionary.
Write a program to find the key with the maximum length value in a dictionary.
Implement a function to remove all occurrences of a specified value from dictionary values.
Write a Python program to invert a dictionary (swap keys and values).
Implement a function to merge dictionaries with arbitrary depth.
Write a program to group a list of dictionaries by a specific key.

Functions:

Write a Python program to implement the Tower of Hanoi puzzle using recursion.
Write a program to generate all possible valid combinations of parentheses.
Write a Python program to calculate the determinant of a square matrix using recursion.
Implement a function to generate all permutations of a string using recursion.
Write a program to implement the quicksort algorithm using recursion.