Inserting and deleting elements in a list
Let's start with the code style, even though not asked explicitly.

It says C++, but apart from using a constructor on the struct  and using new/delete, that is pure C what you have written there.

Especially the C style input and output handling is overcomplicated, with regards to how much simpler the C++ interfaces are to use.



As for your implementation, you don't need a linked list. In fact, you don't need to store the input nor the output sequence at all, at least not for the algorithm itself.

Take a look at the problem carefully again, and try to think about how you can rephrase the operations, when do you need to consume input, and what the earliest point is, at which you can create output. Last but not least, how long do you even need to store each specific piece of information.

The first observation:
Whenever an operation has finished, the value at POS is no longer mutated, and no further insertions or deletions occur prior to POS.

The second observation:
During an operation at POS, no value other than POS has an effect on that operation. At most POS+1 is either removed or added in.

The third observation:
As all numbers are guaranteed to be natural numbers, even c - 1 &gt; 0 must hold. Which means that in any case, POS+1 is always output in the same operation as which it is mutated in.



With that in mind, it's actually quite simple to solve this problem:

#include &lt;iostream&gt;
#include &lt;vector&gt;

int main()
{
    std::vector&lt;int&gt; input;
    int rounds = 0;
    bool even = false;

    // Collect the input
    std::cin &gt;&gt; rounds;
    int temp;
    while(std::cin &gt;&gt; temp) {
        input.push_back(temp);
    }

    even = (input.size() % 2) == 0;

    std::vector&lt;int&gt;::iterator it = input.begin();

    // Special handling for first element
    std::cout &lt;&lt; *it;
    it++;

    for(int round = 0; round &lt; rounds; round++) {
        // Number of steps to the right
        int steps = *it;
        if(even) {
            // Operation "R"
            // Skip one
            it++;
            // And pass through from input
            for(int i = 0; i &lt; steps; i++, it++) {
                std::cout &lt;&lt; " " &lt;&lt; *it;
            }
        } else {
            // Operation "X"
            // Directly output `POS+1`
            std::cout &lt;&lt;  " " &lt;&lt; *it - 1;
            // But pass through one less input in return
            for(int i = 0; i &lt; steps - 1; i++, it++) {
                std::cout &lt;&lt;  " " &lt;&lt; *it;
            }
        }
        even != even;   
    }
    for(; it != input.end(); it++) {
        std::cout &lt;&lt;  " " &lt;&lt; *it;
    }
}


It is unfortunately still necessary to store the entire input in memory, in order to count the elements. If it wasn't for that, you could just copy from input to output element wise.

But what's important: The data structure used is now a plain vector, which removes a lot of unnecessary stress on the memory system, as the storage method is a compact as it gets.

There are also no mutations to that data structure at all, it only serves to replay the input after counting all elements.