Programs implemented in Python 2.7 as part of the 210CT Coursework Assignment.
-
Build a Binary Search Tree (BST) to hold English language words in its nodes. Use a paragraph of any text in order to extract words and to determine their frequencies. Input: You should read the paragraph from a suitable file format, such as .txt. The following tree operations should be implemented: a) Printing the tree in pre-order. b) Finding a word. Regardless whether found or not found your program should output the path traversed in determining the answer, followed by yes if found or no, respectively.
-
Implement a functionthat deletes a node in a binary search treein a language of your choice.
-
Implement the structure for an unweighted, undirected graph G, where nodes consist of positive integers. Also, implement a function isPath(v, w), where v and w are vertices in the graph, to check if there is a path between the two nodes. The path found will be printed to a text file as a sequence of integer numbers (the node values).
-
Using the graph structure previously implemented, implement a function isConnected(G) to check whether or not the graph is strongly connected. The output should be simply 'yes' or 'no'.
-
Implement BFS and DFS traversals for the above graphstructure. Save the nodes traversed in sequence to a text file.6.Adapt thepreviousgraph structureto support weighted connections and implementDijkstra’salgorithm.