Notes - Imperative Programming HT23, Linked lists


Flashcards

How might you define a node in a linked list in Scala?


class Node[A](data: A, next: Node)

Why are singlularly-linked lists bad for appending elements to?


To find the last element, we have to traverse all $n$ elements.

Programs

Implement a doubly-linked list with insertion, deletion and traversal.


Todo.




Related posts