|home |print view |recent changes |changed December 1, 2017 | |You are 188.8.131.52 <- set your identity!
You have already implemented the
wlist programm twice (once with
std::string (Ex4) and once with your
word (Ex5)). The implementation using
word should be rather short, only a few lines. Until now your
wlist output contained the words in ascending order, from
z. Modify the existing behavior in the following ways and create two new versions of
word(ascending order). You might need to provide means for getting the size of a
Similar to the wfavorite program from last week, only print the 7th most frequent word.
Do not reuse exact code of
wfavorite, but again use the most optimal data structure and algorithms for this problem.
Read a text from standard input line by line. While reading count the line numbers. Create a data structure that keeps each word (use your word class) together with all line numbers it occurs upon. Print out a sorted list of words (one word per line), each followed by a list of the line numbers it occurs upon.
Hello Hello again Song by who?output:
again 2 by 3 Hello 1 2 Song 3 who 3
Use standard functors and the
std::transform algorithm to fill an
std::vector consisting of 10 ones with the 10 squares 1, 4, ..100. Do not use a loop. Do not use
std::iota(). Do not use a lambda. Start with the following vector:
|home |print view |recent changes |changed December 1, 2017 |
|You are 184.108.40.206
<- set your identity!