Problem

Unique substrings of length k. Write a program that takes an integer command-line argument...

Unique substrings of length k. Write a program that takes an integer command-line argument k, reads in text from standard input, and calculates the number of unique substrings of length k that it contains. For example, if the input is CGCCGGCCGCG, then there are five unique substrings of length 3: CGC, CGG, GCG, GGC, and GGG. This calculation is useful in data compression. Hint: Use the string method substring(i, i+k) to extract the ith substring and insert into a symbol table. Test your program on a large genome from the booksite and on the first 10 million digits of π.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search