I'm having a problem with something that shouldn't really be a secret since it seems simple to do it.
I'm trying to implement the Huffman code and my idea would be like this:
1 2 3 4
[1] -> [3] -> [2]
| | |
v v v
[a] [b] [c]
The numbers represent the ammount of time the given letter has appeared in the string while the character, well .. it's the character itself.
I've declared a Node class (with right, left, valueInteger and valueCharacter) and the vector of Nodes (vector<Node> vectorOfNodes).
I'm trying to insert the tuple looking [1,a] into the first position but how can I do this?
Using the insert function isn't working and I can't seem to find a way to solve this.