Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4,6 TrustPilot
logo-home
Examen

Over 500 comprehensive programming and computer science questions and answers

Note
-
Vendu
-
Pages
682
Grade
A+
Publié le
29-03-2024
Écrit en
2023/2024

This document contains over 500 comprehensive programming and computer science questions and answers that are well explained.

Établissement
Cours











Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

École, étude et sujet

Cours

Infos sur le Document

Publié le
29 mars 2024
Nombre de pages
682
Écrit en
2023/2024
Type
Examen
Contient
Questions et réponses

Sujets

Aperçu du contenu

Our telegram channel - https://t.me/sppumcq
click here to join
Data Structure Questions and Answers –
Array and Array Operations
Next »

This set of Data Structure Multiple Choice Questions & Answers (MCQs) focuses on
“Array and Array Operations―.

1. Which of these best describes an array?
a) A data structure that shows a hierarchical behavior
b) Container of objects of similar types
c) Arrays are immutable once initialised
d) Array is not a data structure
View Answer

advertisement

2. How do you initialize an array in C?
a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3};
c) int arr[3] = {1,2,3};
d) int arr(3) = (1,2,3);
View Answer

3. How do you instantiate an array in Java?
a) int arr[] = new int(3);
b) int arr[];
c) int arr[] = new int[3];
d) int arr() = new int(3);
View Answer

4. Which of the following is the correct way to declare a multidimensional array in Java?
a) int[] arr;
b) int arr[[]];
c) int[][]arr;
d) int[[]] arr;
View Answer

5. What is the output of the following Java code?

, advertisement
public class array
{
public static void main(String args[])
{
int []arr = {1,2,3,4,5};
System.out.println(arr[2]);
System.out.println(arr[4]);
}
}

a) 3 and 5
b) 5 and 3
c) 2 and 4
d) 4 and 2
View Answer

6. What is the output of the following Java code?

public class array
{
public static void main(String args[])
{
int []arr = {1,2,3,4,5};
System.out.println(arr[5]);
}
}

a) 4
b) 5
c) ArrayIndexOutOfBoundsException
d) InavlidInputException
View Answer

advertisement

7. When does the ArrayIndexOutOfBoundsException occur?
a) Compile-time
b) Run-time
c) Not an error
d) Not an exception at all
View Answer

8. Which of the following concepts make extensive use of arrays?
a) Binary trees
b) Scheduling of processes
c) Caching
d) Spatial locality
View Answer

9. What are the advantages of arrays?
a) Objects of mixed data types can be stored
b) Elements in an array cannot be sorted

,c) Index of first element of an array is 1
d) Easier to store elements of same data type
View Answer

10. What are the disadvantages of arrays?
a) Data structure like queue or stack cannot be implemented
b) There are chances of wastage of memory space if elements inserted in an array are lesser
than the allocated size
c) Index value of an array can be negative
d) Elements are sequentially accessed
View Answer

11. Assuming int is of 4bytes, what is the size of int arr[15];?
a) 15
b) 19
c) 11
d) 60
View Answer

advertisement

12. In general, the index of the first element in an array is __________
a) 0
b) -1
c) 2
d) 1
View Answer

13. Elements in an array are accessed _____________
a) randomly
b) sequentially
c) exponentially
d) logarithmically
View Answer

Sanfoundry Global Education & Learning Series – Data Structure.

To practice all areas of Data Structure, here is complete set of 1000+ Multiple Choice
Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our
social networks below and stay updated with latest contests, videos, internships and jobs!

Telegram | Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Youtube | LinkedIn | Instagram | Facebook | Twitter | Pinterest
» Next - Data Structure Questions and Answers – Stack Operations – 1
Categories Data Structure MCQs, DS MCQs 1 - Abstract Data Types Post navigation
Best Reference Books – Current Trends in Agronomy
Data Structure Questions and Answers – Stack Operations – 1
advertisement

, advertisement

Recommended Posts:

1. Data Science Questions and Answers
2. Java Programming Examples on Collection API
3. Java Programming Examples on Exception Handling
4. Java Programming Examples on Java.Lang
5. C# Programming Examples on Sorting
6. C Programming Examples on Searching and Sorting
7. Data Structures & Algorithms II – Questions and Answers
8. Java Programming Examples on Combinatorial Problems & Algorithms
9. Java Programming Examples
10. C# Programming Examples on Data Structures
11. Java Programming Examples on Utility Classes
12. C Programming Examples on Arrays
13. C Programming Examples on Stacks & Queues
14. C++ Programming Examples on Data-Structures
15. C Programming Examples on Data-Structures
16. C# Programming Examples on Arrays
17. Java Programming Examples on Arrays
18. Java Programming Examples on Collections
19. Java Programming Examples on Data-Structures
20. Data Structure Questions and Answers

advertisement


Data Structure Questions and Answers –
Stack Operations – 1
« Prev
Next »

This set of Data Structure Multiple Choice Questions & Answers (MCQs) focuses on
“Stack Operations – 1―.

1. Process of inserting an element in stack is called ____________
a) Create
b) Push
c) Evaluation
d) Pop
View Answer

Answer: b
Explanation: Push operation allows users to insert elements in the stack. If the stack is filled
completely and trying to perform push operation stack – overflow can happen.
advertisement
€9,63
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
wanjeripeter94

Faites connaissance avec le vendeur

Seller avatar
wanjeripeter94 University of Toronto
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
0
Membre depuis
1 année
Nombre de followers
0
Documents
9
Dernière vente
-

0,0

0 revues

5
0
4
0
3
0
2
0
1
0

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions