Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. TreeSet

Tag: TreeSet

j
java May 31, 2008 5 min read by mkyong 0 comments

Java – Check if array contains duplicated value

This article shows a few ways to detect if an array contains a duplicated value. Java 8 Stream, compare the array size. TreeSet, compare the array size. Two for loops, classic algorithm, 0(n^2). Set, 0(n). Bitmap, boolean[] 0(n). All the above solutions are tested with the below program and generate the same output. (except 5. […]

Read more Java – Check if array contains duplicated value

Java and Spring tutorials since 2008. Every example is a complete, runnable file, compiled and run on a real machine before it goes out.

About This Site

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use

© 2026 mkyong.com — Powered by WordPress

RSS