ตัวอย่างการเขียน ของ วีลิสต์

รหัส(code) เขียนด้วยภาษาจาวา (Java) ซึ่งได้ดัดแปลงให้การนับจำนวนข้อมูลใช้เวลา O(1) และเพิ่มเมธ็อด (method) เพิ่มเติมเข้าไป

public class Vlist {	private static class Block {		Object[] element;		Block base;		int size;		int lastUsed;		int offSet;		public Block(int size, Block base) {			this.size = size;			this.base = base;			if (base == null)				this.offSet = 0;			else				this.offSet = base.offSet + base.size;			this.lastUsed = 0;			element = new Object[size];		}	}	Block header;	final int r = 2;	public Vlist() {		header = new Block(0, null);		header.base = new Block(2, null);	}	public void add(Object e) {		if (header.base.element[header.base.lastUsed] != null				&& header.base.lastUsed + 1 == header.base.size) {			header.base = new Block(header.base.size * 2, header.base);		}		if (header.base.element[header.base.lastUsed] == null) {			header.base.element[header.base.lastUsed] = e;			return;		}		header.base.element[++header.base.lastUsed] = e;	}	public int size() {		return header.base.offSet + header.base.lastUsed + 1;	}	public Object get(int index) {		Block current = header.base;		while (index - current.offSet < 0) {			current = current.base;		}		return current.element[index - current.offSet];	}	public void removeLast() {		if (header.base == null)			return;		header.base.lastUsed--;		if (header.base.lastUsed < 0) {			header.base = header.base.base;		}	}	public void set(int index, Object e) {		Block current = header.base;		while (index - current.offSet < 0) {			current = current.base;		}		current.element[index - current.offSet] = e;	}	public int indexOf(Object e) {		Block current = header.base;		int index = size() - 1;		while (current != null) {			if (current.element[index - current.offSet].equals(e))				return index;			index--;			if (index < current.offSet)				current = current.base;		}		return -1;	}}