I want to calculate the complexity of an algorithm for which i need to mention each line of algorithm cost and frequency as a separate cell for each row of algorithm. I intend to write it in the fashion as shown at the end. I am using the algorithmic package, using it inside the tabular is giving many errors. I hope there is some way to do it.
___________________________
|1| x=0 | c | 1 |
|2| y=0 | c | 1 |
|3| for z=0 to n| c | n+1 |
---------------------------
not the duplicate of the question marked, as it says to write the algo in a column while i want each row to carry an each line of algorithm, that's why I have also added the same question in my comments for ease of understanding.
algorithm2eor could you use another package, such aslistings? – CarLaTeX Sep 26 '17 at 05:26