Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Data Structures Reference

Can anyone give me references of a web site containing a summary of the main Java data structures, and their respective complexity in time (for some given operations like add, find, remove), e.g. Hashtables are O(1) for finding, while LinkedLists are O(n). Some details like memory usage would be nice too.

This would be really helpful for thinking in data structures for algorithms.

like image 884
Samuel Carrijo Avatar asked Aug 13 '09 21:08

Samuel Carrijo


People also ask

Can I do DSA in Java?

Data Structures are the programmetic way of storing data so that data can be used efficiently. Almost every enterprise applicaton uses various types of data structures in one or other way.

Is HashMap a data structure?

A HashMap is a data structure that is able to map certain keys to certain values.

Is ArrayList a data structure?

An ArrayList is a built-in data structure that uses a dynamic array to store its elements. In order to use this data structure, you must import java. util. ArrayList at the top of your program.


3 Answers

Is there a reason to think that Java's implementation is different (in terms of complexity) than a generic, language agnostic implementation? In other words, why not just refer to a general reference on the complexity of various data structures:

NIST Dictionary of Algorithms and Data Structures

But, if you insist on Java-specific:

Java standard data structures Big O notation

Java Collections cheatsheet V2 (dead link, but this is the first version of the cheatsheet)

like image 116
Matthew Nizol Avatar answered Sep 18 '22 18:09

Matthew Nizol


The most comprehensive Java Collections overview is here

http://en.wikiversity.org/wiki/Java_Collections_Overview

like image 23
Eugene Ryzhikov Avatar answered Sep 19 '22 18:09

Eugene Ryzhikov


I found very useful The Collections Framework page, expecially the Outline of the Collections Framework, where every interface/class is breeefly described. Unfortunately there's no big-O information.

like image 43
bluish Avatar answered Sep 20 '22 18:09

bluish