Hi there, i wish to limit my TinyDb to have only 60 data entries. Everytime a new data key in, the old one will be deleted. Is it possible to do that? Below are my data view and blocks
After insert new data to tbData at index 1, check if the length of the tbData is >60. if yes, then delete index 61.
Yes, it is a Queue implimentation, as
Anke
August 21, 2022, 6:40am
4
Which one is "the old" ?
This seems to be a question of "FIFO" or "LIFO"
FIFO and LIFO accounting are methods used in managing inventory and financial matters involving the amount of money a company has to have tied up within inventory of produced goods, raw materials, parts, components, or feedstocks. They are used to manage assumptions of costs related to inventory, stock repurchases (if purchased at different prices), and various other accounting purposes. The following equation is useful when determining inventory costing methods:
"FIFO" stands for first-in, firs...
In this case, i am referring to FIFO.
1 Like
Anke
August 21, 2022, 7:10am
7
I don't understand. What do these terms ("queue / stack") have to do with my statement (link)?
Yes, that is also good to understand.. and here, these are just to orgnize data because of it nature, we can think of Queue at ticket window (first person in Q will be served first), and Stack of books (last book which was put on stack will be available to access first).
Anke
August 21, 2022, 7:24am
9
This (LIFO / FIFO) has nothing to do with queues and stacks, it's about how inventory is valued.
Sorry, I don't agree, since this is what, I had learned in my Data Structure Course,
In computer science, a queue is a collection of entities that are maintained in a sequence and can be modified by the addition of entities at one end of the sequence and the removal of entities from the other end of the sequence. By convention, the end of the sequence at which elements are added is called the back, tail, or rear of the queue, and the end at which elements are removed is called the head or front of the queue, analogously to the words used when people line up to wait for goods or s...
In computer science, a stack is an abstract data type that serves as a collection of elements, with two main principal operations:
The order in which elements come off a stack gives rise to its alternative name, LIFO (last in, first out). Additionally, a peek operation may give access to the top without modifying the stack. The name "stack" for this type of structure comes from the analogy to a set of physical items stacked on top of each other. This structure makes it easy to take an item off t...
and.. one thing can have many uses, not just accounting
2 Likes
Anke
August 21, 2022, 7:50am
11
Ok, so this view is all about the order in which data is handled/used. In this respect, a different approach from computer science, not from economics.
So probably more relevant here.
Anke
August 21, 2022, 8:01am
12
Btw, I don't have a computer science background / education (as my profile shows).
But I'm pretty sure the terms "LIFO/FIFO" originated in economics and were adopted (and redefined) in computer science.
1 Like