Showing posts with label institute. Show all posts
Showing posts with label institute. Show all posts

Sunday, September 27, 2020

Stack(Abstract Data Type): A Quick Overview

Stack


Stack is an abstract data type. It’s underlying data structure is an array or linked list.

Stack works on the concept of “Last In First Out” or “First In Last Out”


Let’s understand the concept of stack by an example. We have a bookshelf and 10 different books. How do we keep the books on the bookshelf? One book on top of another book. So, This way the last book will always be kept on the top. So If we want to get any book we have to take the top book first. Then, the next book will be taken off. Following this, the last book will be the same book that has been kept at first.


The basic operation of stack are: push(), pop() and peek()


Push operation:

The push operation puts the item to the top of stack. It’s very simple and can be done in O(1).



Pop operation:

The pop operation takes out the top item from the stack. It’s also a simple operation and can be done in O(1).



Peek operation:

The peek operation returns the value of the top element of stack. It does not take out the element from the stack. Stack remains as it is. It’s very simple and can be done in O(1).



stack.push(10)







10


Stack


stack.push(20)






20

10


Stack


stack.push(30)





30

20

10


Stack


stack.pop()

=30





20

10


Stack


stack.peek()

=20





20

10


Stack



  • Illustration of push, pop and peek operation



Application of Stack:

  • In the DFS algorithm, stack works as an underlying data structure.

  • Finding strongly connected components in a graph

  • Finding Euler-cycles in graphs.


Implementation in Python / Java will be here

Monday, August 27, 2018

What It Feels Like Being A Student of NIT Running On Temporary Campus.

Being a student of an Institute like NIT is an honour itself. But It seems so to outer world. Because the reality is quite different from it. I personally realized it, felt it - "How it feels like living in an institute having no permanent campus. Like all other NIT, NIT Sikkim is also an Institute of national importance, run by central government and funded by MHRD. But Somewhere I feel that this NIT has been given lower priority than other. Because Firstly, It has been allocated to a remote place(Ravangla), where there is no basic facilities like - medical, transport, food etc. available. Secondly, It has been started in 2010 along with 9 other NITs. But almost all other NIT have got their permanent campus. Infact the newer NIT like NIT Andhra Pradesh established in 2015 have their permanent campus today. Then why only NIT Sikkim is left back in this race. Here the condition of Hostel is also miserable. We have to live upto 5 students in a small room which tends to study problem and noise problem. If I expose to Academics, due to temporary running campus, the classes are  not that much enough to run academics comfortably. Sometimes it happens that the students go to class and find some other class running there, they have to wait. So now you can imagine - " How it feels like living in such institute. So all the students are on strike, hampering their academics for permanent campus. Voices are rising on twitter like "WE WANT PERMANENT CAMPUS.", "WE WANT JUSTICE." and so on along with hashtags like - #TheHomelessNIT, #NotInRavangla, #NoMoreDelay etc. So you can see all the students have burning desire for getting Permanent Campus.
Lastly, I would like to quote -
"Na Sangarsh, Na Takleef,
To Kya Maja Hai Jeene Me"
 "Bade-Bade Toofan Tham Jate Hai,
Agar Aag Lagi Ho Seene Me."

       We won't quit until we get permanent campus.