Data Structure and Algorithms using Java Week 2 Nptel Answers

Are you looking for the Data Structure and Algorithms using Java Week 2 NPTEL Answers 2024 (July-Dec)? You’ve come to the right place! We provide accurate and detailed solutions to help you with your Week 2 assignments in this course.

Image for Data Structure and Algorithms using Java Week 2 Nptel  Answers
Data Structure and Algorithms using Java Week 2 Nptel Answers

Course Link: Click Here

Data Structure and Algorithms using Java Week 2 Nptel Answers

Session: JUL-DEC 2024


Q1.Which of the following classes is part of the Java Collections Framework and implements the List interface?
a. HashSet
b. LinkedList
c. TreeMap
d. PriorityQueue

Answer: b. LinkedList


Q2. Which of the following is True in the case of Java Collection Framework(JCF)?
a. JCF provides mid-performance software encoding
b. Extending and/or adapting a collection is easy and not flexible with JCF
c. The JCF is consist of : Collections and Facilities
d. The JCF doesn’t allow different types of collections to work with a high degree of interoperability.

Answer: c. The JCF is consist of : Collections and Facilities


For answers or latest updates join our telegram channel: Click here to join

These are Data Structure and Algorithms using Java Week 2 Nptel Assignment Answers


Q3. Which of the following interfaces is not part of the Java Collections Framework?
a. Set
b. Queue
c. Map
d. Stream

Answer: d. Stream


Q4. Which of the following statements is true regarding legacy classes in the Java Collections Framework?
a. All legacy classes have been deprecated and should no longer be used.
b. Legacy classes are fully compatible with the Java Collections Framework and have not been deprecated.
c. Legacy classes are part of the Java Collections Framework and implement all collection interfaces.
d. Legacy classes are new additions to the Java Collections Framework introduced in Java 8.

See also  Data Structure and Algorithms using Java Week 3 Nptel Answers

Answer: b. Legacy classes are fully compatible with the Java Collections Framework and have not been deprecated


For answers or latest updates join our telegram channel: Click here to join

These are Data Structure and Algorithms using Java Week 2 Nptel Assignment Answers


Q5. Which interface extends SortedSet to handle retrieval of elements based on closest-match?
a. Set
b. SortedSet
c. NavigableSet
d. Collection

Answer: c. NavigableSet


Q6.Which of the following statements is/are incorrect for Java Collection Framework (JCF)?
a. Vector is similar to. ArrayList, which represents a dynamic array
b. Stack is a subclass of Vector that implements a standard last-in,first-out stack.
c. Unlike HashMap, Hashtable doesn’t store Key/value pairs.
d. Class Properties are used to maintain a list of values in which both key and value are String.

Answer: c. Unlike HashMap, Hashtable doesn’t store Key/value pairs.


For answers or latest updates join our telegram channel: Click here to join

These are Data Structure and Algorithms using Java Week 2 Nptel Assignment Answers


Q7. In the Java Collections Framework (JCF), the Properties class extends __?
a. HashMap
b. Hashtable
c. TreeMap
d. HashSet

Answer: b. Hashtable


Q8. In the Java Collections Framework, TreeMap extends which class and implements which interface?
a. Extends HashMap; implements sortedMap
b. Extends AbstractMap; implements NavigableMap
c. Extends Hashtable; implements TreeSet
d. Extends LinkedHashMap; implements List

Answer: b. Extends AbstractMap; implements NavigableMap


For answers or latest updates join our telegram channel: Click here to join

These are Data Structure and Algorithms using Java Week 2 Nptel Assignment Answers


Q9. In the Queue interface of the Java Collections Framework, what do the peek() and poll() methods respectively do?
a. Both methods retrieve and remove the head of the queue.
b. Both methods retrieve but do not remove the head of the queue.
c. peek() retrieves and removes the head of the queue, while poll() retrieves but does not remove the head of the queue.
d. peek() retrieves but does not remove the head of the queue, while poll() retrieves and removes the head of the queue.

See also  Data Structure and Algorithms using Java Week 4 Nptel Answers

Answer: d. peek() retrieves but does not remove the head of the queue, while poll() retrieves and removes the head of the queue.


Q10.Which of these interface handle sequences?
a. Set
b. Array
c. List
d. Collection

Answer: c. List


For answers or latest updates join our telegram channel: Click here to join

These are Data Structure and Algorithms using Java Week 2 Nptel Assignment Answers

Want all Weeks of Data Structure and Algorithms using Java Nptel Assignment Answers : Click here

For answers to additional Nptel courses, please refer to this link: NPTEL Assignment Answers