Java
-
Usage and distinction between abstract classes and interfaces in Java
I. Abstract Classes In Java, the keyword for abstraction is `abstract`. Abstract classes are created for inheritance, clearly and simply telling the user and compiler what the class should look like. For example, the syntax for declaring an abstract class is: `abstract class Abc {…`
-
Depth-first and breadth-first traversal and their Java implementations
Graph traversal, in essence, is the process of visiting nodes. Given a graph with numerous nodes, traversing these nodes requires a specific strategy. Generally, there are two traversal strategies: Depth-First Traversal (DFT) and Breadth-First Traversal (BFT). Depth-First Traversal starts from the initially visited node, and we know…
-
Three implementations of Java Stack (array, container, linked list)
Source: https://segmentfault.com/a/1190000002516799 A stack is a linear data structure that restricts insertion and deletion operations to only one end of the list. Java does not have a data structure called a stack; if you want to utilize…
-
Differences between Set, List, and Map in Java
Reprinted from: http://jax-work-archive.blogspot.com/2015/02/java-setlistmap.html Arrays are of fixed size, and the same array can only store data of the same type (basically...