Stack In Data Structure | Data Structure and Algorithm | Data Structure in Urdu/Hindi смотреть онлайн
Here we have started Data Structures Complete Course. In this course ,We will try our best to delivery knowledge to you guys. If you like our videos then subscribe our channel and also share it with your friends and fellows.
What is a stack?
A stack is a data structure of ordered items such that items can be inserted and removed only at one end.
1. A stack is a LIFO (Last-In/First-Out) data structure
2. A stack is sometimes also called a pushdown store.
What are some applications of stacks?
1. Program execution
2. Parsing
3. Evaluating postfix expressions
What can we do with a stack?
push - place an item on the stack
Peek/Top - Look at the item on top of the stack, but do not remove it
pop - Look at the item on top of the stack and remove it
Push (ItemType newItem) :
Function: Adds newItem to the top of the stack.
Preconditions: Stack has been initialized and is not full.
Postconditions: newItem is at the top of the stack.
Pop (ItemType& item) :
Function: Removes topItem from stack and returns it in item.
Preconditions: Stack has been initialized and is not empty.
Postconditions: Top element has been removed from stack and item is a copy of the removed element.
Problem:
What happens if we try to pop an item off the stack when the stack is empty?
This is called a stack underflow. The pop method needs some way of telling us that this has happened. In java we use the java.util.EmptyStackException
Implementing a Stack :
There are two ways we can implement a stack:
Using an array
Using a linked list
Implementing a Stack
Implementing a stack using an array is fairly easy.
The bottom of the stack is at data[0]
The top of the stack is at data[numItems-1]
push onto the stack at data[numItems]
pop off of the stack at data[numItems-1]
Implementing a stack using a linked list isn’t that bad either…
Store the items in the stack in a linked list
The top of the stack is the head node, the bottom of the stack is the end of the list
push by adding to the front of the list
pop by removing from the front of the list
We can use a stack to reverse the letters in a word.
How?
Read each letter in the word and push it onto the stack
When you reach the end of the word, pop the letters off the stack and print them out.
In order to create a stack, we must import java.util.stack package and use the Stack() constructor of this class. The below example creates an empty Stack.
#datastructures
#datastructuresandalgorithms
#binary
#binarysearchtree
#binarysearch
#data
#sortingalgorithm
#searching
#searchingAlgorithm
#datastructure
#datastructureandalgorithm
#datastructureinhindi
Download Ppt File :
https://docs.google.com/presentation/d/1_g0VBcXarFwqshe_xwxLPR_7LvSRYh6n/edit?usp=sharing&ouid=111342912251298124514&rtpof=true&sd=true
In the case of any queries Contact us at:
Email us:
[email protected]
Like us on Facebook:
Link: https://www.facebook.com/TheKacsAcademy/
Follow us on Twitter:
Link : https://twitter.com/Zeeshan99237099
Instagram :
Link : https://www.instagram.com/thekacs6
#Subscribe #Data_Structures_by_KacsAcademy
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Stack In Data Structure | Data Structure and Algorithm | Data Structure in Urdu/Hindi» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.