Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Searching through a list of vectors

Name: Anonymous 2013-04-30 2:35

Ok guys and gals I have made a random generator which stores the values in list and puts them in a text file but how do I search through list of vectors? basically my data looks like this
[A|b, c, ,c,c,e,]
the first letter is always capital and then lower case I have to look through the list and then keep count and I have shown below what output should be like... I dont need you to code or anything I just need to be pointed in right direction
1. Implement a code that begins with the following user interface:
Please choose from this menu
(G) Generate a new, random data set(user enters size)
(L) Load a specific file
(F) Print to screen Current data set
(S) Save current file
(Q) Quit
The data object consists of two characters and an integer. The first character is capitalized the second lower case, the integer is initialized to 0 and represent the frequency that a particular object has appeared. You are store randomly generated objects in a STL list of STL vectors. The list parameter is the capital letter, and the vector parameter is the lower case, each time that a matching capital/lower case object is generated it is added to the data collection, if it does not already exists it is added to the vector and the frequency is set to 1 otherwise the frequency is incremented and the object discarded.
Sample Data set (option G)
Input size of data set : 15
Ab Cd Ka Zk Al Ab Rb Zm Ab St Ra Vt Am Al Aa
Output to Screen(Option F)
A| b-3, 1-2, m-1, a -1
C|d-1
K|a-1
Z |k-1, m-1
R| b-1, a-1
S| t-1
V| t-1

Name: Anonymous 2013-04-30 2:49

n

Name: Anonymous 2013-04-30 3:06

Are you fucking serious? How can you not figure this out on your own? Oh right, because you won't take five minutes to read the documentation. Die in a fucking fire, retard.

Name: Anonymous 2013-04-30 3:14

stl sounds like c/c++/?
but yeah, scan the list then the vector..? you could sort them but it should be pretty fast anyway..

Name: Anonymous 2013-04-30 3:22

Why store it in such an odd way? This just needs int dist[26*26] of space. Accessing a frequency is just dist[(up_letter - 65) + (low_letter - 97) * 26)]

I guess you might have a sparse matrix, in which case a hash mapping is probably the way to go about it.

Name: Anonymous 2013-04-30 19:15

retard

Name: Anonymous 2013-04-30 19:42

yep am a retard thats why I am asking for help.....
heres my code so far if someone wants to help
The code is buggy so... any help is appreciated but I have to store it this way.
http://pastebin.com/u3jQmcv1

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List