Data Structure And Algorithms Using Java Assignment 2 Answers 2023

In this post we have provided answers of NPTEL Data Structure And Algorithms Using Java Assignment 2. We provided answers here only for reference. Plz, do your assignment at your own knowledge.

NPTEL Data Structure And Algorithms Using Java Week 2 Assignment Answers 2023

1. Which of the following is/are FALSE in the case of Data Structure in Java?

a. Array is an indexed linear data structure
b. linked list is a sequential non- linear data structure
C. stack and queue are Linear data structure
d. set, tree, table, and graph are Non-linear data structure

Answer :- b. linked list is a sequential non- linear data structure

2. 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 

3. Which among the following is a Java Collection Framework(JCF) Class?

a. Set
b. List
c. Queue
d. Vector

Answer :-  d. Vector

4. Choose the right option to complete the following sentence in the case of EnumSet EnumSet extends AbstractSet and implements

a. Enum type
b. Enum
c. AbstractSet
d. Set

Answer :- d. Set

5. Which of the following statement is incorrect with respect to ‘Map’ in Java?

a. A Map is an obiect that maps keys to values
b. Map is a collection of key-value pairs.
c. Map is a generic interface that has the declaration: interface Map <I>
d. SortedMap interface doesn’t extend Map.

Answer :- d. SortedMap interface doesn't extend Map.

6. 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.

7. In Java Collection Framework(JCF) Dictionary is ___________?

a. A concrete implementation
b. An interface
c. An abstract class
d. A data structure for storing only integers

Answer :-c. An abstract class 

8. Which of the following interface(s) is (are) NOT descendant(s) of java.util.Collection?

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

Answer :- a. java.util. SortedMap 

9. Which of the following declaration(s) is(are) not correct to instantiate a collection object?

a. List <data-type list1 = new ArrayList():
b. List <data-type list2 = new LinkedList();
c. List <data-type list3 = new Vector():
d. List <data-type list4 = new PriorityQueue() :

Answer :- d. List <data-type list4 = new PriorityQueue :

10. Which of these interface handle sequences?

a. Set
b. Array
c. List
d. Collection

Answer :- c. List 
Course NameData Structure And Algorithms Using Java
CategoryNPTEL Assignment Answer
Home Click Here
Join Us on TelegramClick Here

NPTEL Data Structure And Algorithms Using Java Assignment 2 Answers 2022

1. 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<k, V> 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.

Answer:- b, c, d

2. 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

Answer:- d

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

Data Structure And Algorithms Using Java Assignment 2 Answers 2023

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

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

Answer:- d

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

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

👇For Week 03 Assignment Answers👇

Data Structure And Algorithms Using Java Assignment 2 Answers 2023

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 More NPTEL Answers:- CLICK HERE

Join Our Telegram:- CLICK HERE

About Data Structure And Algorithms Using Java

With the growth of Information and Communication Technology, there is a need to develop large and complex software. For developing large software, software developers should have enough proficiency of data structures and algorithms. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment.

Now, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to distributed systems. This course aims to cover the essential topics of data structures and algorithms and how the same can be implemented using Java programming language. The participants of the proposed course will be able to improve their skills, to cope with the current demand of IT industries and solve many problems in their own filed of studies.

COURSE LAYOUT

  • Week 1: 1D array, list and vector, 2D matrices and tables of objects
  • Week 2: Java implementation of 1D and 2D arrays and its operations
  • Week 3: Linked lists and its various operations, stack and queue
  • Week 4: Java implementation of linked lists, stack and queue
  • Week 5: Binary trees: Representation and operations. Variations of binary tree: Binary search tree, Height balanced search tree, Heap tree
  • Week 6: Java implementation of binary trees and its variations
  • Week 7: Graph : Structure, representation and operations
  • Week 8: Java implementations of graph data structures
  • Week 9: Algorithms (Part-I): Searching and sorting algorithms
  • Week 10:Java implementation of Part-I algorithms
  • Week 11:Algorithms (Part-II): Greedy algorithms, shortest path algorithms
  • Week 12:Java implementation of Part-II algorithms

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

Leave a Comment