This is a “Doubly” Linked List
195132
function LinkedList( ... elements ) {
	this.head = null ;
	this.tail = null ;
	this.length = 0 ;

	if ( elements.length ) {
		this.push( ... elements ) ;
	}
}
1236919
int deleteList(int list) {
		clear(list);
		int prevList = m_lists.getField(list, 2);
		int nextList = m_lists.getField(list, 3);
		if (prevList != nullNode())
			setNextList_(prevList, nextList);
		else
			m_list_of_lists = nextList;

		if (nextList != nullNode())
			setPrevList_(nextList, prevList);

		freeList_(list);
		return nextList;
	}
389689
private Tree<Row> findNext( Tree<Row> pointer ){
        if( pointer.hasNext() ){
            // The given tree-node is not the last in its block.
            if( Type.END.equals( pointer.getNext().getContent().getType() ) ){
                return null;
            }
            else{
                return pointer.getNext();
            }
        }
        // The given tree-node was last in its block. Then we return the
        // the block closing tree-node.
        Tree<Row> parent = pointer.getParent();
        Type parentType = parent.getContent().getType();
        if( Type.WHILE_DO_BEGIN.equals( parentType ) ){

            return parent.getNext();
        }
        else if( Type.DO_WHILE_BEGIN.equals( parentType ) ){
            return parent.getNext();
        }
        if( Type.BRANCH.equals( parentType ) ){
            Tree<Row> join = parent.getParent().getNext();
            return join;
        }
        else if( Type.IF.equals( parentType ) || Type.ELSE_IF.equals( parentType ) || Type.ELSE.equals( parentType ) ){
            Tree<Row> endIf = findEndIf( parent );
            return endIf;
        }
        else{
            throw new IllegalStateException( "Unknown containting block type for row " + parent.getContent() );
        }
    }
818226
private static int countTailoredNodes(long[] nodesArray, int i, int strength) {
        int count = 0;
        for(;;) {
            if(i == 0) { break; }
            long node = nodesArray[i];
            if(strengthFromNode(node) < strength) { break; }
            if(strengthFromNode(node) == strength) {
                if(isTailoredNode(node)) {
                    ++count;
                } else {
                    break;
                }
            }
            i = nextIndexFromNode(node);
        }
        return count;
    }
1090926
function addNextNodesToASTObject(ASTObject) {
  const ASTObjectsForDepths = [ASTObject];
  function addNextNodes(ASTObject, depth) {
    const depthPlus1 = depth + 1;
    ASTObjectsForDepths[depthPlus1] = ASTObject;
    if (ASTObject.left)
      addNextNodes(ASTObject.left, depthPlus1);
    if (ASTObject.right)
      addNextNodes(ASTObject.right, depthPlus1);
    if (ASTObject.next) {
      const ASTObjectForDepth = ASTObjectsForDepths[depth];
      if (ASTObjectForDepth.nextNodes)
        ASTObjectForDepth.nextNodes.push(ASTObject.next);
      else
        ASTObjectForDepth.nextNodes = [ASTObject.next];
      addNextNodes(ASTObject.next, depth);
    }
  }
  addNextNodes(ASTObject, 0);
}
464304
function mergeListSiblings( listNode )
	{
		var mergeSibling;
		( mergeSibling = function( rtl )
		{
			var sibling = listNode[ rtl ? 'getPrevious' : 'getNext' ]( nonEmpty );
			if ( sibling &&
			     sibling.type == CKEDITOR.NODE_ELEMENT &&
			     sibling.is( listNode.getName() ) )
			{
				// Move children order by merge direction.(#3820)
				mergeChildren( listNode, sibling, null, !rtl );

				listNode.remove();
				listNode = sibling;
			}
		} )();
		mergeSibling( 1 );
	}
62668
def p_stmt_list(p):
    
    if len(p) == 2:
        p[0] = node.stmt_list([p[1]] if p[1] else [])
    elif len(p) == 3:
        p[0] = p[1]
        if p[2]:
            p[0].append(p[2])
    else:
        assert 0
442192
function(array) {
    var firstNode = array.length - 2;
    var nextNode = array.length - 1;
    var currentDepth, availableNodes, lastNode, i;

    for (currentDepth = 1, availableNodes = 2;
         availableNodes > 0;
         currentDepth++) {
      lastNode = firstNode;
      firstNode = first (array, lastNode - 1, 0);

      for (i = availableNodes - (lastNode - firstNode); i > 0; i--) {
        array[nextNode--] = currentDepth;
      }

      availableNodes = (lastNode - firstNode) << 1;
    }
  }
1232537
function listNext(node, pred) {
  pred = pred || func.fail;

  const nodes = [];
  while (node) {
    if (pred(node)) { break; }
    nodes.push(node);
    node = node.nextSibling;
  }
  return nodes;
}
350414
private Deque<MutablePair<DeltaType, Object>> combineDeltas(
      LinkedList<MutablePair<DeltaType, Object>> deltas) {
    if (deltas.size() < 2) {
      return deltas;
    }
    int size = deltas.size();
    MutablePair<DeltaType, Object> d1 = deltas.peekLast();
    MutablePair<DeltaType, Object> d2 = deltas.get(size - 2);
    MutablePair<DeltaType, Object> out = isDuplicate(d1, d2);
    if (out != null) {
      Deque<MutablePair<DeltaType, Object>> newDeltas = new LinkedList<>();
      newDeltas.addAll(deltas.subList(0, size - 2));
      newDeltas.add(out);
      return newDeltas;
    }
    return deltas;
  }
283744
function includes (data, value) {
    var iterator, iteration, keys, length, i;

    if (! assigned(data)) {
      return false;
    }

    if (haveSymbols && data[Symbol.iterator] && isFunction(data.values)) {
      iterator = data.values();

      do {
        iteration = iterator.next();

        if (iteration.value === value) {
          return true;
        }
      } while (! iteration.done);

      return false;
    }

    keys = Object.keys(data);
    length = keys.length;
    for (i = 0; i < length; ++i) {
      if (data[keys[i]] === value) {
        return true;
      }
    }

    return false;
  }
255063
function List(parameters) {
    abstractions.Collection.call(this, utilities.types.LIST, parameters);

    // the array is a private attribute so methods that use it are defined in the constructor
    const array = [];

    this.acceptVisitor = function(visitor) {
        visitor.visitList(this);
    };
    
    this.toArray = function() {
        return array.slice();  // copy the array
    };

    this.getSize = function() {
        return array.length;
    };
    
    this.getItem = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        return array[index];
    };
    
    this.setItem = function(index, item) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        item = this.convert(item);
        const oldItem = array[index];
        array[index] = item;
        return oldItem;
    };
    
    this.addItem = function(item) {
        item = this.convert(item);
        array.push(item);
        return true;
    };
    
    this.insertItem = function(index, item) {
        item = this.convert(item);
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        array.splice(index, 0, item);
    };
    
    this.insertItems = function(index, items) {
        const iterator = items.getIterator();
        while (iterator.hasNext()) {
            const item = iterator.getNext();
            this.insertItem(index++, item);
        }
    };
    
    this.removeItem = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        const oldItem = array[index];
        if (oldItem) array.splice(index, 1);
        return oldItem;
    };
    
    this.removeItems = function(range) {
        const items = new List(this.getParameters());
        const iterator = range.getIterator();
        while (iterator.hasNext()) {
            const index = iterator.getNext();
            const item = this.removeItem(index);
            items.addItem(item);
        }
        return items;
    };
    
    this.sortItems = function(sorter) {
        sorter = sorter || new utilities.Sorter();
        sorter.sortCollection(this);
    };
    
    this.reverseItems = function() {
        array.reverse();
    };

    this.shuffleItems = function() {
        const size = this.getSize();
        for (var index = size; index > 1; index--) {
            const randomIndex = utilities.random.index(index);  // in range [1..index] ordinal indexing
            const item = this.getItem(index);
            this.setItem(index, this.getItem(randomIndex));
            this.setItem(randomIndex, item);
        }
    };
    
    this.deleteAll = function() {
        array.splice(0);
    };

    return this;
}
976710
function _link_comp(str1, str2){

	// Decompose links and arguments.
	var tmp1 = str1.split('?');
	var head1 = '';
	var args1 = [];
	if( ! tmp1[1] ){ // nothing before '?'
	    args1 = tmp1[0].split('&');
	}else{ // normal structure
	    head1 = tmp1[0];
	    args1 = tmp1[1].split('&');
	}
	var sorted_args1 = args1.sort();

	var tmp2 = str2.split('?');
	var head2 = '';
	var args2 = [];
	if( ! tmp2[1] ){ // nothing before '?'
	    args2 = tmp2[0].split('&');
	}else{ // normal structure
	    head2 = tmp2[0];
	    args2 = tmp2[1].split('&');
	}
	var sorted_args2 = args2.sort();

	// var tmp2 = str2.split('?');
	// var head2 = tmp2[0];
	// var args2 = tmp2[1].split('&');
	// var sorted_args2 = args2.sort();

	// Compare heads and arguments.
	var retval = false;
	if( head1 == head2 &&
	    _same_array(sorted_args1, sorted_args2) ){
	    retval = true;
	}
	return retval;
    }
295671
function multi(list /*, ... */) {
		var mw = core.base();
		mw.targets = (isArray(list) ? list : Array.prototype.slice.call(arguments.length, 0));
		mw.enabled = true;
		mw.writeln = function (line) {
			if (mw.enabled) {
				for (var i = 0, ii = mw.targets.length; i < ii; i++) {
					mw.targets[i].writeln(line);
				}
			}
		};
		mw.toString = function () {
			return '<miniwrite-multi>';
		};
		return mw;
	}
409260
function (value) {
        var node;

        if (value instanceof LinkedListNode) {
            node = value;
            validateNode(node, this);

            if (node._next === node) {
                this.head = null;
            }
            else {
                node._next._prev = node._prev;
                node._prev._next = node._next;

                if (this.head === node) {
                    this.head = node._next;
                }
            }
            node._list = null;
            node._next = null;
            node._prev = null;
            this.size--;

            return true;
        }
        else {
            if ((node = this.find(value)) !== null) {
                this.remove(node);
                return true;
            }
            return false;
        }
    }
65661
int createList() {
		int node = newList_();
		if (m_b_allow_navigation_between_lists) {
			m_lists.setField(node, 3, m_list_of_lists);
			if (m_list_of_lists != nullNode())
				m_lists.setField(m_list_of_lists, 2, node);
			m_list_of_lists = node;
		}

		return node;
	}
502813
@Override
    protected Node<K, V> unionWithComparator(Node<K, V> root1, Node<K, V> root2) {
        if (root1 == null) {
            return root2;
        } else if (root2 == null) {
            return root1;
        }

        Node<K, V> newRoot;
        Deque<LeftistNode<K, V>> path = new LinkedList<LeftistNode<K, V>>();

        // find initial
        int c = comparator.compare(root1.key, root2.key);
        if (c <= 0) {
            newRoot = root1;
            root1 = unlinkRightChild(root1);
        } else {
            newRoot = root2;
            root2 = unlinkRightChild(root2);
        }
        Node<K, V> cur = newRoot;
        path.push((LeftistNode<K, V>) cur);

        // merge
        while (root1 != null && root2 != null) {
            c = comparator.compare(root1.key, root2.key);
            if (c <= 0) {
                // link as right child of cur
                if (cur.o_c == null) {
                    cur.o_c = root1;
                } else {
                    cur.o_c.y_s = root1;
                }
                root1.y_s = cur;
                cur = root1;
                path.push((LeftistNode<K, V>) cur);
                root1 = unlinkRightChild(root1);
            } else {
                // link as right child of cur
                if (cur.o_c == null) {
                    cur.o_c = root2;
                } else {
                    cur.o_c.y_s = root2;
                }
                root2.y_s = cur;
                cur = root2;
                path.push((LeftistNode<K, V>) cur);
                root2 = unlinkRightChild(root2);
            }
        }

        if (root1 != null) {
            // link as right child of cur
            if (cur.o_c == null) {
                cur.o_c = root1;
            } else {
                cur.o_c.y_s = root1;
            }
            root1.y_s = cur;
        }

        if (root2 != null) {
            // link as right child of cur
            if (cur.o_c == null) {
                cur.o_c = root2;
            } else {
                cur.o_c.y_s = root2;
            }
            root2.y_s = cur;
        }

        /*
         * Traverse path upwards, update null path length and swap if needed.
         */
        while (!path.isEmpty()) {
            LeftistNode<K, V> n = path.pop();

            if (n.o_c != null) {
                // at least on child
                LeftistNode<K, V> nLeft = (LeftistNode<K, V>) n.o_c;
                int nplLeft = nLeft.npl;
                int nplRight = -1;
                if (nLeft.y_s != n) {
                    // two children
                    LeftistNode<K, V> nRight = (LeftistNode<K, V>) nLeft.y_s;
                    nplRight = nRight.npl;
                }
                n.npl = 1 + Math.min(nplLeft, nplRight);

                if (nplLeft < nplRight) {
                    // swap
                    swapChildren(n);
                }

            } else {
                // no children
                n.npl = 0;
            }

        }

        return newRoot;
    }