New Text Document
New Text Document
Sure! Here are some coding questions, ranging from basic to advanced, to help you
practice your Python skills:
Write a Python program to count the occurrences of each word in a given text file.
Write a Python program to find the longest common subsequence in two strings.
Write a Python program to find the lowest common ancestor in a binary tree.
Write a Python program to find the shortest path in a graph using Dijkstra's
algorithm.
Write a Python program to find the minimum spanning tree of a graph using Kruskal's
algorithm.
Write a Python program to find the maximum subarray sum using Kadane's algorithm.
Write a Python program to implement the knapsack problem using dynamic programming.
Write a Python program to find the maximum flow in a network using the Ford-
Fulkerson algorithm.
Write a Python program to solve the traveling salesman problem using dynamic
programming.
Write a Python program to find the convex hull of a set of points using the Graham
scan algorithm.
Write a Python program to solve the edit distance problem using dynamic
programming.
Write a Python program to implement the Viterbi algorithm for hidden Markov models.
Write a Python program to find the k-th smallest element in a list using a heap.
Write a Python program to implement the Hopcroft-Karp algorithm for maximum
bipartite matching.
Write a Python program to implement the Bellman-Ford algorithm for finding shortest
paths in a weighted graph.
Write a Python program to implement the Johnson's algorithm for finding shortest
paths in a sparse graph.
Write a Python program to implement the Edmonds-Karp algorithm for finding maximum
flow in a network.
Write a Python program to implement the push-relabel algorithm for finding maximum
flow in a network.
Write a Python program to implement the Tarjan's algorithm for finding strongly
connected components in a graph.
Write a Python program to implement the Prim's algorithm for finding the minimum
spanning tree of a graph.
Write a Python program to implement the Kruskal's algorithm for finding the minimum
spanning tree of a graph.
Write a Python program to implement the Ford-Fulkerson algorithm for finding the
maximum flow in a network.
Write a Python program to implement the Edmonds-Karp algorithm for finding the
maximum flow in a network.
Write a Python program to implement the push-relabel algorithm for finding the
maximum flow in a network.
Write a Python program to implement the Dijkstra's algorithm for finding the
shortest path in a weighted graph.