Data Structure And Algorithms Using Java Assignment 1 Answers 2022

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

NPTEL Data Structure And Algorithms Using Java Assignment 1 Answers

1. Which feature can be implemented using encapsulation?

a. Inheritance
b. Abstraction
c. Polymorphism
d. Overloading

Answer:- b

2. Which of the following best describes encapsulation?

a. It is a way of combining various data members into a single unit.
b. It is a way of combining various member functions into a single unit.
C. It is a way of combining various data members and member functions into a single unit which can operate on any data.
d. It is a way of combining various data members and member functions that operate on those data members into a single unit.

Answer:- d

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

Data Structure And Algorithms Using Java Assignment 1 Answers 2022

3. Which of the followving should be encapsulated?

a. The data which is prone to change is near future.
b. The data prone to change in long terms.
c. The data which is intended to be changed.
d. d. The data which belongs to some other class.

Answer:- a

4. What will be the output?

import java.1o.*
class Q
public static void swap(int x, int y)
int temp;
temp = x
y=X
y= temp;
System.out.print(x+" " + y);
public statie void main(String[] args)
intx = 100;
int y= 10;
Swap(x, y);
  • a. 100 10
  • b. 10 100
  • c. 10 10
  • d. 100 100
Answer:- d

5. Why are generics used?

a. Generics make code more fast.
b. Generics make code more optimized and readable.
c. Generncs add stability to your code by making more of your bugs detectable at compile time.
d. Generics add stability to your code by making more of your bugs detectable at a runtime.

Answer:- c

6. Which of the following is true?

a. Generic programming and function overloading are very similar to each other.
b. With method overloading you can pass any type of data argument but with generic programming it is limited.
c. For generic programming to work, multiple functions of the same logic need to be created for different data types.
d. Method overriding is a fancy name for method overloading.

Answer:- a

ЁЯСЗFor Week 02 Assignment AnswersЁЯСЗ

Data Structure And Algorithms Using Java Assignment 1 Answers 2022

7. Fill in the missing blank to implement it as a generic program?

class DemoClass<T>{
void genericPrint(
System.out.println(t);
public static void main (String[] args) {
DemoClass obj = new DemoClass0;
obj.genericPrint("HT");
obj genericPrint(1000)
  • a. intt
  • b. floatt
  • c. double t
  • d. T t
Answer:- d

8. How do we implement variable sized arguments in generic programming?

a. Aray
b. Variable argument
c. varars
d. getch

Answer:- a

9. T extends superclass> is used to implement which of the following?

a. Lower bound
b. Upper bound
c. Middle bound
d. None of the above.

Answer:- b

10. Why do we need to study data structures?

a. Because it’s a really hot topic in this era, like Machine Learning, Deep Learning.
b. Because it’s an ancient topic and we should know the history of computers
c. It is essential for developing a large, complex and critical software.
d. Data structures help us organize and access different types of data in the most efficient format according to our needs.

Answer:- c, 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.

5 thoughts on “Data Structure And Algorithms Using Java Assignment 1 Answers 2022”

  1. 4. What will be the output?

    Correct answer is : D
    ———————————
    6. Which of the following is true?

    Correct answer is : A

    Not “C” because In generic programming only one function is created for all different datatype but not multiple functions

    Reply
  2. 8. How do we implement variable sized arguments in generic programming?

    Correct answers is : A

    array is use for variables length datatype

    Reply

Leave a Comment