Questions tagged [lifo]

LIFO is an acronym that stands for last in, first out. In computer science and queueing theory this refers to the way items stored in some types of data structures are processed.

LIFO is an acronym that stands for last in, first out. In computer science and queueing theory this refers to the way items stored in some types of data structures are processed.

63 questions
0
votes
2 answers

See if two strings equal using stacks

The objective is to have two strings, in which in this string, there is a backspace button represented as <. However, the output of two strings with differently positioned backspace button should be equal. For the InputsEqual function, it basically…
TheRoadLessTaken
  • 531
  • 2
  • 7
  • 15
0
votes
0 answers

how to undo pictureBox drawline C# windows form using Microsoft Visual Studio

And trying get working small paint application, that draws only lines with mouse event. Could someone provide me with correct working example how to create undo functionality? I have picturebox1 with Events pictureBox1_MouseDown,…
Yanka
  • 21
  • 1
  • 5
0
votes
1 answer

Java : Lifo Compensation Method

Is there an easy solution to implement LIFO solution based on Java? For instance I have the following In (50,150,200) Out (all after all the inputs) (250,80) The results should be something like this: Initial - Final 200 - 200 200 - 50 150 - 80 150…
Katherine99
  • 980
  • 4
  • 21
  • 40
0
votes
1 answer

get objects from a list in LIFO order? (Last-In-First-Out) (Beginner)

(Please, bear in mind that this is a beginners problem) I have two classes; MailItem and MailServer. I have a testing class, where I make and send MailItems to my MailServer. I sent to MailItems to one specific user, and I expect to retreive these…
CJR
  • 3,174
  • 6
  • 34
  • 78
0
votes
2 answers

how can I program my code so it displays a stack order from top to bottom in python for a LIFO structure

i've got the code working but I've written my code in python implementing a stack, it is pushing and popping following LIFO but when you view the list it prints it as: 1 2 3 showing the last item which is 3 at the bottom, how can I make it show…
lisa turner
  • 31
  • 1
  • 5
0
votes
1 answer

LIFO STACK (Windows application)

I need to do an excercise with windows form but I'm beginner programer on c#, and I want help.. First... I need to list this numbers on a windows Form: -20, 45, -10, 20, 1 but I dont know if I only need to use label of toolbox and change value to…
0
votes
1 answer

Python Multiprocessing With (LIFO) Queues

I'm trying to use multiprocessing in Python to have a function keep getting called within a loop, and subsequently access the latest return value from the function (by storing the values in a LIFO Queue). Here is a code snippet from the main…
user3543300
  • 499
  • 2
  • 9
  • 27
0
votes
2 answers

Order of execution of Threads waiting for a synchronised block

I have some threads running and all trying to enter the synchronised block. I have noticed that the thread runs in a random order(when i calls Thread.start()), thats ok when first Thread executes and enters synchronised method it go to sleep..…
Amir Ashfaq
  • 335
  • 4
  • 11
0
votes
1 answer

Usergrid collection Last In First Out

The default behavior for usergrid collection seems to be the entities that were added first are retrieved first when doing a GET. Can I have the entities retrieved in the reverse order, i.e. the entities added last are retrieved first. I know I can…
nilesh
  • 35
  • 3
0
votes
1 answer

LIFO memory vhdl code understanding

I have this code for a lifo memory and I don't understand why on 27 line (if(last = n-2) then full <= '1'; end if;) the last signal it's not equal to n-1. If anyone could explain it to me I would really appreciate. library ieee; use…
sixfeet
  • 934
  • 4
  • 16
  • 33
0
votes
2 answers

Inserting into a priority queue only using the first argument in python

How do I insert items into a priority queue, but ensure that it only takes as it's priority the first argument given. For example: #push up if((pacman_r != 0 ) and (cellGrid[pacman_r-1][pacman_c].what != '%')): priorityQueue.put((4,…
David
  • 1,398
  • 1
  • 14
  • 20
0
votes
0 answers

Intel-Based Assembly Lang. Output from stack

So at the moment my out put is: Area: 17 | Points: 1 | Probability: 64 / 134519798 when it should be: Area: 1 | Points: 17 | Probability: 1 / 64 The values pushed in stack goes from First to last: 64 1 17 1 So first out should be the 1 then…
user2922055
  • 23
  • 1
  • 1
  • 4
-1
votes
1 answer

How i can change the top of my stack in C++?

Whats is wrong in this code, i need to change the top of my stack. That's is my code and i need to change the top of my stack Also, i need to change my function imprime to print from the bottom to the top. Something like 10 15 20, in the function…
Breno Sobral
  • 71
  • 2
  • 11
-1
votes
2 answers

How to get true LIFO order, out of the stack?

How to add int values and then iterate through stack getting LIFO order? Adding 7 and 1 returns 7 and 1. public void calculate_10to99() { Stack romanNumeralsStack = new Stack(); romanNumeralsStack.add(7); …
mat1
  • 83
  • 10
-1
votes
1 answer

How recursion uses stack data structure?

I had read recently that recursion uses system stack for storing return addresses of function calls. So, I just made a random code to understand this LIFO concept in recursion int fun( int x) { if ( x<6 || x>6 ) { cout<
T.g
  • 169
  • 2
  • 11