NPTEL Data Structure And Algorithms Using Java ASSIGNMENT 2 Answers 2022

Data Structure And Algorithms Using Java ASSIGNMENT 2

NPTEL Data Structure And Algorithms Using Java ASSIGNMENT 2 Answers:- Hello students in this article we are going to share NPTEL Data Structure And Algorithms Using Java assignment week 2 answers. All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

Below you can find NPTEL Data Structure And Algorithms Using Java ASSIGNMENT 2 Answers

Assignment No.Answers
Data Structure And Algorithms Using Java Assignment 1 Click Here
Data Structure And Algorithms Using Java Assignment 2 Click Here
Data Structure And Algorithms Using Java Assignment 3 Click Here
Data Structure And Algorithms Using Java Assignment 4 Click Here
Data Structure And Algorithms Using Java Assignment 5 Click Here
Data Structure And Algorithms Using Java Assignment 6 Click Here
Data Structure And Algorithms Using Java Assignment 7 Click Here
Data Structure And Algorithms Using Java Assignment 8 Click Here

NPTEL Data Structure And Algorithms Using Java ASSIGNMENT 2 Answers 2022:-

Q1. Which of the following is true in the case of Class Hashtable?

a. Like HashMap, Hasht able also stores key/value pairs. However, keys and values can be null.
b. Hashtable was made generic by JDK 5. It is declared like this: class Hashtable Here, K specifies the type of keys, and V specifies the type of values.
c. Like HashMap, Hasht able also stores key/value pairs. However, neither keys nor values can be null.
d. There is one more difference between HashMap and Hashtable, that is, Hashtable is synchronized while HashMap is not.

Answers:- b,c,d

Q2. Which of the following is true in the case of method E peek0″?

a. Peek the element on the top of the stack. removing it in the process
b. Peek the element on the top of the stack, and return it
c. Retums the element on the top of the stack, but does remove it
d. Retums the element on the top of the stack. removing it in the process

Answers:- c

Q3. Which of the following is NOT a Java legacy class?

a. Dictionary
b. Hashtable
c. Vector
d. Set

Answers:- c

4. Which of the following statement(s) is/are true?

a. Iterator interface provides the facility of iterating the elements in a forward direction only.
b. List interface is implemented by the classes ArayList, LinkedList, Vector, and Stack.
c. Iterator interface provides the facility of iterating the elements in a backward direction only.
d. List interface supports duplicate values.

Answer:- a,c,d

Next Week Assignment Answers

quizxp telegram

5. Which of the following declaration(s) is/are correct to instantiate the List interface?

a. List <data-type> list1= new ArayList):
b. List <data-type> list2 = new LinkedList):
c. List <data-type> list3 = new Vector0:
d. List <data-type> list4 = new PriorityQueue)

Answer:- a,b,c

6. Which of the following is/are not core collection classes?

a. AbstractCollection
b. EnumSet
C. HashSet
d. AbstractQueue

Answer:- d

7. Which of the following statement(s) is/are true?

a. Vector is similar to ArrayList which represents a dynamic array.
b. Vector is synchronized while ArrayList is not.
c. EnumSet is a Bit string data structure.
d. TreeSet is an Indexed data structure.

Answer:- a,b,c

8. Which of the following statement(s) is/are true according to the advantages of a collections framework?

a. Reduces programming effort.
b. Increases performance.
c. Reduces the effort required to leam APIs.
d. Provides interoperability between unrelated APIs.

Answer:- a,b,c,d

9. Which of the following() collection interface(s) is/are descendants of not java.util.Collection?

a. java.util.SortedMap
b. java.util.Set
c. java.util.SortedSet
d. java.util.Queue

Answer:- a

10. Which of the following is/are can be used if a variable can be accessed using Objeet class method?

a. Upper bound wildcard
b. Lower bound wildcard
c. Unbounded wildcard
d. No wildcard

Answer:- c

For Internship and job updates:- Visit

Disclaimer: We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.

if you have any suggestions then comment below or contact us at [email protected]

If you found this article Interesting and helpful, don’t forget to share it with your friends to get this information.NPTEL PROGRAMMING IN JAVA ASSIGNMENT 2 Answers 2022