Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i=position/row;
- int j=position%row;
- int u,l,ul,maxValue;
- //std::vector<char> p;
- std::vector<std::tuple<char,char,char>> p;
- while(memory[i*row+j]!=0)
- {
- l = memory[i*row+j - 1];
- u = memory[i*row+j - row];
- ul = memory[i*row+j - row - 1];
- maxValue = maxFun(l,u,ul);
- if(maxValue == ul)
- {
- p.insert(p.begin(),std::make_tuple('m',s1[i],s2[j]));
- i--;
- j--;
- }
- else if(maxValue==u)
- {
- //p.insert(p.begin(),'d');//Gi[i][j]+1);
- p.insert(p.begin(),std::make_tuple('d','-',s2[j]));
- i = i - 1; //- Gi[i][j] - 1;
- }
- else if(maxValue==l)
- {
- //p.insert(p.begin(),'i');
- p.insert(p.begin(),std::make_tuple('i',s1[i],'-'));
- j = j - 1; //- Gd[i][j] - 1;
- }
- }
- return p;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement