first() { //Return first element //Return null for empty case if (this.isEmpty()) return null return this.get(0) }
linearSearch(anElem) { //Return matching element //or null if no match let i = 0 while (i < this.size()) { let nextElem = this.get(i) if (nextElem.equals(anElem)) return nextElem i++ } return null }