Content deleted Content added
Added alternatives to Dijkstra's Shunting Yard (description requires accompanying external links) |
Rewrote parenthesise.c to emphasize the essence of the algorithm. |
||
Line 83:
<pre>
#include <stdio.h>
#include <string.h>
▲int main(int argc, char **argv)
printf("((((");
▲ int i, tab;
for
if( strcmp(argv[i], "^")==0) printf(")^(");
else if(strcmp(argv[i],
else if(strcmp(argv[i], "-")==0) printf(")))-(((");
else printf("%s", argv[i]);
}
printf("))))\n");
return 0;
}
</pre>
|