Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. int i=position/row;
  2. int j=position%row;
  3. int u,l,ul,maxValue;
  4. //std::vector<char> p;
  5. std::vector<std::tuple<char,char,char>> p;
  6. while(memory[i*row+j]!=0)
  7. {
  8. l = memory[i*row+j - 1];
  9. u = memory[i*row+j - row];
  10. ul = memory[i*row+j - row - 1];
  11. maxValue = maxFun(l,u,ul);
  12. if(maxValue == ul)
  13. {
  14. p.insert(p.begin(),std::make_tuple('m',s1[i-1],s2[j-1]));
  15. i--;
  16. j--;
  17. }
  18. else if(maxValue==u)
  19. {
  20. //p.insert(p.begin(),'d');//Gi[i][j]+1);
  21. p.insert(p.begin(),std::make_tuple('d','-',s2[j-1]));
  22. i = i - 1; //- Gi[i][j] - 1;
  23. }
  24. else if(maxValue==l)
  25. {
  26. //p.insert(p.begin(),'i');
  27. p.insert(p.begin(),std::make_tuple('i',s1[i-1],'-'));
  28. j = j - 1; //- Gd[i][j] - 1;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement