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
1
vote
1 answer

sequences on a LIFO stack

I'm studying for a midterm and I need help with this question: Suppose that an intermixed sequence of push and pop operations are performed on a LIFO stack. The pushes push the numbers 0 through 9 in order; the pops print out the return value. Which…
Tammiexao
  • 33
  • 3
1
vote
1 answer

RegEx - LIFO buffer on match events

How is it possible to make a LIFO buffer on match events by using regex in Javascript? Here's an example: Input: 4 Mål Vålerenga, 1 - 0 Torgeir Børven. Målgivende pasning Daniel Fredheim Holm.
Dagens kaptein, Fredheim Holm, med en smart…
0
votes
0 answers

Vlookup items details with lifo method in Excel or Google sheets

I want to lookup the purchase records for a list of items having one quantity each from a data having following fields column a,b,c,d,e as follows item code, quantity, date, invoice number, discount in such a way that it uses the lifo principle but…
0
votes
0 answers

How to convert LIFO stack to FIFO queue

A queue is a data storage device much like a stack. The difference is that in a stack the last data item stored is the first one retrieved, while in a queue the first data item stored is the first one retrieved. That is, a stack uses a…
0
votes
0 answers

calc FIFO based inventory valuation with MySQL 8.0

nice day for all. I spent more than three days of searching and testing but nothing helped me. let us assume I have many way to enter items of product to storages, So I created 'view' to show me the product transactions "in" like…
Anas deve
  • 11
  • 6
0
votes
1 answer

Python how to build a LIFO stack using only FIFO queues

I have a very tough question here: how to build a LIFO stack using only FIFO queues ? So I already have most of the code,but as you can see below ,I don't know how to code the pop function import queue class MyLifo: def __init__(self): …
William
  • 3,724
  • 9
  • 43
  • 76
0
votes
0 answers

popitem () method in Python 3.10 does not work as it worked in Python 3.7

In Python 3.7 popitem () method return and remove random pair key-values. But in Python 3.10 popitem () return and remove LIFO pair key-values. What can i use instead popitem () in Python 3.10 for return and remove random pair in dictionary? Thanks!
0
votes
1 answer

Why are the items in my Lifo Queue changing without referring to them?

I am working on a graph coloring problem and I have a dictionary of possible color values (0,1,2,3) each node can take. I am trying a bit of a brute force method here just to get an understanding of the algorithm. I'm running into a simple issue…
lcleary
  • 65
  • 6
0
votes
3 answers

How can I move a value to the bottom of a stack rather than the top?

(This is using the java.util.Stack) In my code I got a value, lets say a string "1" and I want to put that at the bottom of this stack of numbers. "4" "3" "2" Now the methods I have for the java.util.Stack don't actually come with a way I can just…
Zapster
  • 71
  • 1
  • 7
0
votes
1 answer

Difference between Stack and synchronization decorator for ArrayDeque

I want to have LIFO effect and I want it to be synchronized. Does anyone know which one of these two implementations I should use? Been googling for a while, still no good answer. Bottom line: what are differences, why use one over another, why is…
Ana Maria
  • 475
  • 2
  • 11
0
votes
1 answer

How to push and pop a stack of doubles using structures and pointers

There's this assignment that requires me to make items of a specific structure and stack an unlimited number of them. I should also be able to pop the item at the top of the list. I've been able to stack them but when I attempt to pop my program…
0
votes
1 answer

Change Order of scrape data in scrapy python

I am using scrapy to scrape data from a website .And I am getting data in this format. e.g { 'Date': '03/06/2020', 'LTV': '90', } { 'Date': '03/06/2020', 'LTV': '80', } { 'Date': '03/06/2020', 'LTV': '70', } ...I want to change this Sequence. I want…
0
votes
0 answers

How can I make the LIFO principle apply to callbacks?

I'm not one hundred percent sure what the benefit of "LIFO" (regarding threads) in the IOCP is. I guess the last thread that comes back to the "LIFO queue" can be used with less "overhead" than the others. (Correct me if I'm wrong.) Let's say we…
Arre
  • 125
  • 1
  • 7
0
votes
1 answer

Quick Question: Why isn't my call for pop() working? C++ Stacks

I'm learning stacks in my current CS course. I was working on functions and when I went to test, for the pop function I got the error: "no matching function for call to DynStack::pop()" Here's my code: main() #include #include…
cstrike2
  • 55
  • 7
0
votes
1 answer

Tracking LIFO Orders in SQL

I am trying to map inventory using LIFO to determine the dates the orders initially arrived in the inventory to the day that they leave. However, the inventory can go from positive to negative. For example: Day 1: purchase 1,000 units;…