Tuesday, November 14, 2017

Ex no :10 Programs that take command line arguments (word count)



Aim
            To find the word and lines in command line arguments
Algorithm
·         Start
·         Add arguments to find the words and lines
·         Add file name as argument
·         Parse the arguments to get the values
·         Format and print the words
·         Stop 



Ex No: 11 Frequent words in text file



Aim
            To find the most frequent words in a text read from a file.
Algorithm
·         Start
·         Read the filename
·         Open the file
·         Read each line from the file to count the lowers and words
·         Split each line in to words and count them
·         Print the word and counts
·         Stop 

Wednesday, November 1, 2017

Ex.No 7 Merge Sort



Ex no:7                               MERGE SORT
Aim
            To write a python program to sort a list of elements using Merge sort
Algorithm
Step1:Start
Step2:Divide the arrays into left sub array & right sub array
Step3:Conquer by recursively sorting the two sub arrays
Step4:Combine the elements back in by merging the two sorted sub arrays
Step5:Call the results and print the arrays
Step6:Stop

https://drive.google.com/file/d/0ByMcz7t6A0gieUNIR2t5WDJtdTA/view?usp=sharing