Hi,
I am working on a program for an assignment. It is to find all the anagrams contained in an input file.
I have read the file into a vector. Next I created a 2D array that contains the orginal words from the file in 1 column and the signatures for each in the next:
Currently this is what my 2D Array contains
Pans --> ansp
stop --> opts
Pots --> opts
Pots --> opts
opt --> opt
Sit --> its
it's --> sit
What I want to do is sort the 2D array using the second column. This way when I move one word in column 2 I will also move the word at the same index location in column 1.
The result would be
Pans --> anps
snap --> anps
Sit --> its
it's --> its
stop --> opts
Pots --> opts
Pots --> opts
opt --> opt
I am new to programming, please help me if you can.
Thanks