/*implements object list*/

Cell.prototype.constructor = Cell;

function Cell(val,suiv){
	this.val = val;
	this.suiv = suiv;
}

function insert(head,val){
	/*insertion ordonnée sans doublon et renvoie la tête de liste*/
	if (head==null)return new Cell(val,null);/*queue de liste*/
	if (val==head.val)return head;/*val déjà existante*/
	if (val>head.val){/*parcours ordonné*/
		head.suiv = insert(head.suiv,val);
		return head;
	}
	/*cas général insertion au milieu*/
	return new Cell(val,head);
}
