Tag

HashSet

0 views collected around this technical thread.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Dec 30, 2023 · Backend Development

Three Ways to Merge Two Lists and Remove Duplicates in Java

This article demonstrates three practical techniques—using a HashSet, leveraging Java 8 Stream API, and applying Map's merge functionality—to combine two List collections while eliminating duplicate elements, complete with full Java code examples and output illustration.

DuplicateRemovalHashSetJava
0 likes · 5 min read
Three Ways to Merge Two Lists and Remove Duplicates in Java
Architecture Digest
Architecture Digest
Sep 19, 2023 · Fundamentals

Various Ways to Remove Duplicates from a List in Java Using Set Implementations and Streams

This article demonstrates six different techniques for eliminating duplicate elements from a Java List, including HashSet, TreeSet, LinkedHashSet, iterator-based removal, Stream distinct, and manual contains checks, each with complete code examples and output illustrations.

CollectionsDuplicate RemovalHashSet
0 likes · 7 min read
Various Ways to Remove Duplicates from a List in Java Using Set Implementations and Streams
Architect's Tech Stack
Architect's Tech Stack
Aug 3, 2023 · Fundamentals

Performance Comparison of Different Java List Deduplication Methods

This article examines several Java deduplication techniques—including List.contains, HashSet, double-loop removal, and Stream.distinct—by providing sample code, measuring execution time on a 20,000‑element list, and analyzing their time complexities to guide developers toward efficient duplicate‑removal strategies.

CollectionsHashSetJava
0 likes · 7 min read
Performance Comparison of Different Java List Deduplication Methods
政采云技术
政采云技术
May 31, 2022 · Fundamentals

Efficient Parent‑Child Relationship Deduplication Using Hashset Caching

This article presents an efficient deduplication algorithm for parent‑child relationship validation that caches intermediate results in a hashset to eliminate redundant computations, dramatically improving performance and scalability for large datasets by reducing verification steps through stored validated nodes.

HashSetalgorithmdeduplication
0 likes · 11 min read
Efficient Parent‑Child Relationship Deduplication Using Hashset Caching
Selected Java Interview Questions
Selected Java Interview Questions
Sep 29, 2021 · Fundamentals

Why and How to Override hashCode() and equals() in Java

This article explains why Java developers must override both hashCode() and equals() methods for proper object comparison in hash-based collections, outlines the scenarios requiring such overrides, and provides detailed example code demonstrating correct implementations.

CollectionsHashCodeHashSet
0 likes · 7 min read
Why and How to Override hashCode() and equals() in Java
Selected Java Interview Questions
Selected Java Interview Questions
Apr 30, 2021 · Fundamentals

Differences Between HashMap and HashSet and Hash Table Fundamentals

This article explains the fundamental differences between Java's HashMap and HashSet, describes how hash tables work with arrays and linked lists, outlines storage processes, collision resolution methods, resizing strategies, and provides a sample hash function implementation in Java.

Data StructuresHashMapHashSet
0 likes · 6 min read
Differences Between HashMap and HashSet and Hash Table Fundamentals
Architecture Digest
Architecture Digest
Apr 16, 2021 · Backend Development

Five Methods to Remove Duplicates from a Java ArrayList

This article presents five distinct techniques for eliminating duplicate elements from a Java ArrayList, including using LinkedHashSet, Java 8 Stream distinct, HashSet with order preservation, manual contains checks, and a double‑for‑loop approach, each accompanied by complete code examples and output results.

ArrayListCollectionsDuplicate Removal
0 likes · 6 min read
Five Methods to Remove Duplicates from a Java ArrayList
Top Architect
Top Architect
Jan 29, 2021 · Fundamentals

Five Ways to Remove Duplicates from a Java ArrayList

This article presents five distinct methods for eliminating duplicate elements from a Java ArrayList, including using LinkedHashSet, Java 8 streams, HashSet with order preservation, manual iteration with contains checks, and nested loops, each accompanied by complete code examples and output results.

ArrayListDuplicate RemovalHashSet
0 likes · 6 min read
Five Ways to Remove Duplicates from a Java ArrayList
Selected Java Interview Questions
Selected Java Interview Questions
Nov 13, 2020 · Fundamentals

Various Methods to Remove Duplicates from a Java List and Their Performance Comparison

This article demonstrates five different techniques for eliminating duplicate integers from a Java List—including nested loops, contains checks, HashSet, TreeSet, and Java 8 streams—provides complete source code for each method, and compares their execution times under different random data ranges.

HashSetJavaStream
0 likes · 7 min read
Various Methods to Remove Duplicates from a Java List and Their Performance Comparison
IT Xianyu
IT Xianyu
Oct 12, 2020 · Fundamentals

Understanding equals() and hashCode() in Java: When They Matter

This article explains the roles of equals() and hashCode() in Java, demonstrates how their interaction affects hash‑based collections like HashSet, provides multiple code examples showing correct and incorrect implementations, and outlines essential principles for overriding these methods to ensure proper object equality handling.

CollectionsHashCodeHashSet
0 likes · 9 min read
Understanding equals() and hashCode() in Java: When They Matter
Wukong Talks Architecture
Wukong Talks Architecture
Aug 31, 2020 · Fundamentals

Understanding Thread Safety Issues in Java Collections: ArrayList, HashSet, HashMap and Their Solutions

This article explains why core Java collection classes such as ArrayList, HashSet, and HashMap are not thread‑safe, demonstrates the underlying mechanisms of their initialization and resizing, and presents multiple approaches—including Vector, synchronized wrappers, and CopyOnWrite variants—to achieve safe concurrent access.

ArrayListHashMapHashSet
0 likes · 16 min read
Understanding Thread Safety Issues in Java Collections: ArrayList, HashSet, HashMap and Their Solutions
Selected Java Interview Questions
Selected Java Interview Questions
Aug 2, 2020 · Fundamentals

Understanding Java HashSet: Overview, Constructors, add/remove Methods, Traversal, and Related Set Implementations

This article explains the internal workings of Java's HashSet, covering its overview, various constructors, the add and remove operations implemented via HashMap, traversal techniques, and how LinkedHashSet and TreeSet extend HashSet functionality, providing code examples and conceptual diagrams.

CollectionsData StructuresHashSet
0 likes · 10 min read
Understanding Java HashSet: Overview, Constructors, add/remove Methods, Traversal, and Related Set Implementations
Selected Java Interview Questions
Selected Java Interview Questions
Oct 27, 2019 · Fundamentals

Understanding the Relationship Between hashCode() and equals() in Java

This article explains how Java's hashCode() and equals() methods interact, illustrates their behavior with and without hash‑based collections through multiple code examples, and outlines the essential principles developers must follow when overriding these methods to ensure correct functionality in hash tables.

HashCodeHashMapHashSet
0 likes · 11 min read
Understanding the Relationship Between hashCode() and equals() in Java
Java Captain
Java Captain
Sep 25, 2017 · Fundamentals

Java Collection Framework Overview with Code Examples

This article explains the Java collection class diagram, distinguishes concrete classes, abstract classes, and interfaces, describes Iterator and ListIterator behavior, and provides detailed code demonstrations of HashSet, ArrayList, ListIterator, and WeakHashMap usage along with their outputs.

ArrayListCollectionsData Structures
0 likes · 13 min read
Java Collection Framework Overview with Code Examples