Data Structure And Algorithms Using Java Assignment 3 Answers 2023

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

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

1. Which data structure is the collection of finite, ordered, and homogeneous data elements?

a. Array
b. Graph
c. Мар
d. Trees

Answer :- For Answer Click Here

2. Consider the following piece of code.

public class Main {
    public static void main(String args[]) {
        char[] a = {'a', 'b', 'c', 'd', 'e', 'f'};
        for (int i = 0; i < a.length; i = i + 2)
            System.out.print(" " + a[i]);
    }
}

Which of the following is an output of the above program?

a. abodef
b. ace
c. bdf
d. abdf

Answer :- For Answer Click Here

3. Consider the following program.

public class Main {
    public static void main(String args[]) {
        int[] a = new int[0];
        a[0] = 12;
        System.out.println(a);
    }
}

Which of the following is an output of the above program?

a. 12
b. Exception
c. O
d. Null

Answer :- 

5. Which of the following statements is true regarding ArrayList in Java?

a. ArrayList is a synchronized data structure, making it thread-safe.
b. ArrayList allows duplicate elements and maintains insertion order.
c. ArrayList is a resizable array that automatically increases its size when elements are added.
d. ArrayList can only store primitive data types like int, double, and char.

Answer :- For Answer Click Here

6. Which of the following classes implement a dynamic array?

a. ArrayList
b. LinkedList
c. DynamicList
d. AbstractList

Answer :- 

7. Which method is used to remove all elements from an ArrayList?

a. removeAllO
b. clear
c. deleteAllO
d. eraseA110

Answer :- 

8. What will be the output of the following Java code?

Data Structure And Algorithms Using Java Assignment 3 Answers 2023

Which of the following is an output of the above program?

а. “Apple”
b. “Banana”
c. “Orange”
d. IndexOutOfBoundsException will be thrown.

Answer :- For Answer Click Here

9. What is the time complexity of adding an element at the end of an ArrayList?

a. O(1)
b. O(log n)
c. O(n)
d. O(n log n)

Answer :- 

10. Which of the following methods is used to find the index of the first occurrence of a specific element in an ArravList?

a. findIndex
b. indexOf0
c. search
d. findFirstO

Answer :- For Answer Click Here
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 3 Answers 2022

1. What will be the output of following:

int arr [] = new int[];
System.out. println (arr) ;

a. Garbage Value
b. Pointer to Address
c. Compile time Error
d. None of the above

Answer:- c

2. What is the output of the followving code snippet? int arr [] = new int[5] System. out. println (arr) ;

a. Garbage Value
b. Reference Value
c. Compile time Error
d. None of the above

Answer:- b

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

Data Structure And Algorithms Using Java Assignment 3 Answers 2023

3. What is the output of the following code snippet?

int arr [] = new int[-5]

a. Compilation Error
b. Logical Error
C. Exception
d. None of the above

Answer:- c

4. Is the statement in red a legal statement?
int[] a = new int[30]:
int[] b = new int[50]:

a =b; //22

a. Legal Statement
b. Compile time error
c. Runtime error
d. None of these

Answer:- a

5. Which of the following is not a legal declaration of array?

a. int arr|]= new int[3]:
b. int| arr = new int[3]:
C. int arr[|]= {1,2,3,4,5};
d. int arr[]= new int[3]{1,2,3};

Answer:- d

6. Which of the followving is a linear Data Structure?

a. Array
b. Graph
c. Binary Tree
d. Heap Tree

Answer:- a

👇For Week 04 Assignment Answers👇

Data Structure And Algorithms Using Java Assignment 3 Answers 2023

7. What will be the output of the given command? int arr[] = new int[5]; System.out.print(arr[5]);

a. Compile Time Error
b. Garbage Value
c. Reference Address
d. ArrayIndexOutOfBoundsException

Answer:- d

8. What is the default value of Object type array?

a. 0
b. ” “
c. False
d. null

Answer:- d

9. Which of the following returns the length of an Array?

a. length
b. length()
c. size()
d. len()

Answer:- a

10. Which of the following statement is ?

a. Size of an array can be declared at runtime
b. Array is a dynamic data structure.
c. Same Array can store different data types
d. Array is a collection of similar types of elements.

Answer:- d

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