Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
Question
Book Icon
Chapter 21.4, Problem 21.4.2CP
Program Plan Intro

Set:

Set is a data structure that is used for storing and processing non duplicate elements. It is an interface which extends collection and it is an unordered collection of objects.

Set is implemented by LinkedHashSet, HashSet or a TreeSet.

Hash Set:

In order to store its elements internally, the HashSet uses HashMaps and it implements the Set interface, backed by a hash table which is actually a HashMap instance.

ArrayList:

ArrayList provides dynamic arrays in Java and is a part of collection framework and is present in java.util package.

Blurred answer
Students have asked these similar questions
If N represents the number of elements in the collection, then the contains method of the ArrayCollection class is O(1). True or False If N represents the number of elements in the list, then the index-based add method of the ABList class is O(N). True or False
B1. Answer the following: a. Create an ArrayList named Employee of type String. b. Add Ahmed, Mohammed, and Amal to the list? c. Remove Mohammed from the list? d. Write a for loop to print the elements of array list?
True/False 3. Arrays are usually heterogeneous, but lists are homogeneous.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT