அல்கோரிதம்lifo logic

LIFO — கடைசி உள்ளே, முதலில் வெளியே

TT
Testlaa Team
May 14, 20261 min read

LIFO — வரிசை விதி; list/recursion/explicit stack எல்லாம்.

Try this in Python

order = []
for x in ["first", "second", "third"]:
    order.append(x)
while order:
    print(order.pop())

Key takeaways

  • மேல் கீழ் என்ன மறைந்துள்ளது trace.
  • Reverse — push all, pop all.
  • Nested — LIFO.

Tags:

Stacks & queuesPythonமாணவர்கள்