• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
December 16, 2022 |2.4K Views
Python Program to Reverse the Content of a File using Stack
  Share  3 Likes
Description
Discussion

In this video, we will write a Python program to Reverse the Content of a File using Stack. But before that we will first understand the concept of stack in brief.

What is Stack?

Stack is a linear data structure which follows a particular order in which operations are performed. The order maybe:
 

  1. LIFO
  2. FIFO

Stack is initialized & content of file is pushed one by one. Once the file is completely checked & all items are added, stack is popped until it becomes empty & content are restored in file in reverse order.

Python program to Reverse the Content of a File using Stack:
https://www.geeksforgeeks.org/python-program-to-reverse-the-content-of-a-file-using-stack/

Read More