Some real-world examples of the Data structure "Stack"👇
A thread🧵
Stack is a LIFO (Last In First Out) data structure.
🔸A pile of books is an example of a stack. The last book kept on the pile will be removed first i.e LAST IN FIRST OUT (LIFO) data structure
🔸A pile of plates
🔸Stack of chairs
🔸Tower of Hanoi: Famous application of stack
🔸Activities (Screens) in your Android app are arranged in a stack (the back stack) in the order in which each activity is opened.
An example continued 👇
An email app might have one activity to show a list of new messages.
When the user selects a message, a new activity opens to view that message which is added to the back stack.
If the user presses the Back button, that new activity is finished and popped off the stack
🔸Women bangles - Women wear a bangle one by one and to pull the first one they have to first pull out the last one.
🔸Web browsers use the stack to keep track of the history of websites. If you click back then the previous site opens immediately.
🔸Call logs in mobiles use the stack (in which the recent call is on the top)
🔸When a company wants to reduce its workforce. Typically they follow "Last Hired First Fired"
🔸Function call uses the stack
🔸Matching of brackets by the compiler is also implemented using stack.
This is the end of the thread.
Real-life examples for other data structures coming soon. Be sure to give a follow to @meetjain74
📌Blockchain
Blockchain is a distributed decentralized network that provides immutability, privacy, security, and transparency. There is no central authority present to validate and verify the transactions.
Hence we require some consensus protocol.
📌What does consensus means?
A general agreement that is accepted by all people in a group.
In Blockchain, consensus refers to that all nodes in the network reach a particular agreement about the blocks in the blockchain
🎵Music
Your unique musical artwork can be sold in the form of NFT to anyone. The owner has the right to determine how the composition is used.
🎮Gaming
NFTs have the best use case in the gaming world. Unique characters or avatars or items in the game can be bought and sold using NFTs. Example - purchasing weapons for the game via an NFT marketplace to play in the game.
Most of the apps today run on centralized networks i.e they are controlled by a single authority. For example, social media networks, banks, and streaming services hold all of our data on centralized servers.
When you access any of these apps, a request is sent to the server and you gets a response back. Suppose you entered your credentials details to login into that system as a request and the response comes in form of access to the website or not(in case of invalid credentials).
Defi stands for 'Decentralized finance'. It refers to financial applications built on blockchain technology that enable digital transactions between multiple parties.
Before diving into it further, let us first understand centralized or traditional finance.
📌Example scenario
Suppose a person named Luv has some money and he wants to earn interest on that money. What will he do?
You are right!
He will deposit it in any bank and earn interest on that.
Imagine that you and your friend physically far apart attending a 'Justin Bieber' concert 'virtually' with thousands of fans from across the globe together.
No, I don’t mean being part of an online concert of the like we have all attended in the pandemic times.
I am talking of virtual concerts in the Metaverse, which will be much more immersive than listening to a live video.
How do these events take place?
The event organizers can imagine how the concert would look…they will transport you to a beach, the moon, or some fantasy world.