# Tag Info

Accepted

### Is it possible for a stack-based programming language to be concurrent?

So, can stack-based programming languages be concurrent? Sure. Could they achieve concurrency by using multiple stacks at the same time or something alike? Already for normal languages multi-...
• 12.1k
Accepted

### Why is a sequence of n Push, Pop, Multipop operations O(n²)?

First, let me comment on 2 misconceptions I see in your question: Landau notation ('Big $O$ notation') does not exclusively refer to running times, we can use it to describe any function we wish. ...
• 8,303

### Is it possible for a stack-based programming language to be concurrent?

I know a bit about FORTH so I will confine myself to that. It is a low level language, giving you as programmer access to all the hardware resources. So you can do whatever you like. Concurrency In ...
• 426

### Generate all permutations of 1 to n with i stacks

It is not clear in the question what operations are allowed on the input and how to view or access the output. However, since we are dealing with all permutations, the answer is the same whether the ...
• 39.1k
Accepted

### Stack Permutation Algorithm

Ok here's my attempt 2 which won't construct the sequence of moves, but it at least proves what the optimal number of moves is and gives an indicator of how to construct the sequence. I'm addressing ...
• 499

### Is the reason for a stack to decrease the size of a program (by adding the use of subroutines)?

The reason for having a stack is recursion. You don’t need a stack if you don’t have recursion. CDC super computers in the 70s worked just fine without a stack - until they implemented Pascal. On ...
• 30.7k

• 659
Accepted

### Finding the Equation for Potential Method and Amortization Analysis

Amortized analysis is a technique for showing how to distribute the total cost of a worst case sequence of operations among all the operations in the sequence to get an average cost. So, even if there ...
• 2,780
Accepted

### Computing with number of stack items

It depends on what kinds of things you can store on the stack. If each item on the stack is of unbounded size, you can simulate a two-counter machine, which is Turing-complete. Therefore, in this ...
• 162k
Accepted

### Claimed problems with Lisp dynamic scoping

With fact, the primary problem is with f. If n is 0, ...
• 632

### What techniques could be used to support thread-local contexts and resources in a language?

One example of a language system built from bottom up to support this kind of situation is Erlang. It is well worth looking into. It is built around the concept that you create a lot of tasks. The ...
• 426
Accepted

### Why is average waiting time is the same for FIFO and LIFO

Maybe an example will help, consider lets say for 3 minutes we add 2 tasks each minute, and we process 1 task a minute. With a FIFO queue the timeline will be: t(0): 'a' and 'b' added: [a, b] - 'a' ...
• 313