Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. makeatletter
  2. newifif@restonecol
  3. makeatother
  4. letalgorithmrelax
  5. letendalgorithmrelax
  6. usepackage[linesnumbered,ruled,vlined]{algorithm2e}%[ruled,vlined]{
  7. usepackage{algpseudocode}
  8. renewcommand{algorithmicrequire}{textbf{Input:}}
  9. renewcommand{algorithmicensure}{textbf{Output:}}
  10.  
  11. begin{document}
  12.  
  13. begin{algorithm}
  14.  
  15. caption{trace column}
  16. LinesNumbered
  17. KwIn{
  18. $v$:当前访问的节点newline
  19. $c$:当前访问节点所要溯源的列
  20. }
  21. KwOut{
  22. $S$ :遍历所找到的根节点的集合
  23. }
  24. textbf{Initialize} $S=emptyset$ ;
  25. If{$v$ instanceof DataSourceNode}{
  26. $n$.used=false;
  27. $n$.id=$v$.id;
  28. $n$.column=position of $c$ in $v$;
  29. $S=Scup {n}$;
  30. }
  31. ElseIf{node instanceof JoinTreeNode}{
  32. prenode[0]=node.input1;
  33. prenode[1]=node.input2;
  34. For{i=0;i<2;i++}{
  35. If{$c$ is from prenode[i]}{
  36. $S=Scup trace$(prenode[i],position of $c$ in prenode[i]);
  37. If{position of $c$ in prenode[i]=position of key in prenode[i]}{
  38. $S=Scup trace$(prenode[1-i],position of $c$ in prenode[1-i]);
  39. break;
  40. }
  41. break;
  42. }
  43. }
  44. }
  45. return $S$newline
  46. end{algorithm}
  47.  
  48. begin{algorithm}
  49. caption{trace column22}
  50. ....as the same code block....
  51. end{algorithm}
  52.  
  53. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement