Need Homework in STL

I have just learnt STL in C++. Now I want to test my skills.
So please give me some questions from very easy to difficult(not very difficult). So that I can test whether or not I can solve it.

Thank You
Last edited on
Still didn't find anything useful.
1.
a. Create a vector with 1000 random integers in the range [ -10000, +10000 ], in random order, without duplicates.

b. Given two vectors created as in a., count the number of integers common to both.

c. Given the two vectors in b., create a third vector which contains the sums of the numbers in the same positions in the two vectors.

d. Print out the largest 5 numbers in the vector created in c.

e. Print out the mode(s) of the numbers in the vector created in c. https://en.wikipedia.org/wiki/Mode_(statistics)

f. (Not difficult) In the vector created in c., find the subsequence which has the largest sum.


2. Given a file containing a list of about 200,000 unique words in English, for instance: http://svnweb.freebsd.org/base/head/share/dict/web2

a. Write a spelling checker (given a list of 100 words, determine if each of these words is spelt correctly).

b. (Not difficult) Write an anagram finder (given a list of 100 words, find all the anagrams of each of these words in the list).

c. (Difficult) Extend the spelling checker in a. to suggest an alternative correct word for each misspelt word (https://en.wikipedia.org/wiki/Levenshtein_distance)
Topic archived. No new replies allowed.