Subremes Codes

Java 101: Datastructures and algorithms in Java, Part 5

In Part 4, I introduced all the things you can do with singly linked lists and their algorithms in Java. While singly linked lists have many uses, they also present some restrictions. For one thing, singly linked lists restrict node traversal to a single direction: you can’t traverse a singly linked list backward unless you first reverse its node links, which takes time. If you do a reverse traversal and need to restore node-traversal to the original direction, you will have to repeat the inversion, which takes more time. Singly linked lists also restrict node deletion. In this type of list, you cannot delete an arbitrary node without access to the node’s predecessor.

To read this article in full, please click here

Статья полностью:Java 101: Datastructures and algorithms in Java, Part 5