SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
DATA STRUCTURE - MCQs
By www.iteagers.com - Visit for more Mcqs, Past Papers (SPSC/FPSC) and Quiz
1. What is an array?
A. Data structure that stores elements of different data types
B. Data structure that stores elements of the same data type
C. A sorting algorithm
D. A linear equation
2. In C++, the index of the first element in an array is
A. 0
B. 1
C. -1
D. 10
3. What is the time complexity for accessing an element in an array?
A. O(1)
B. O(n)
C. O(log n)
D. O(n^2)
4. How do you declare a one-dimensional array in C?
A. int array[10];
B. array[10] int;
C. array int[10];
D. int[10] array;
5. What is the maximum number of dimensions an array can have in most
programming languages?
A. 1
B. 2
C. 3
D. 4
6. In a two-dimensional array, how is data stored in memory?
A. Sequentially
B. Diagonally
C. In a tree structure
D. Randomly
7. What is the syntax for accessing an element in a two-dimensional array in C++?
A. array[row, column]
B. array(row)(column)
C. array[row][column]
D. array(column, row)
8. Which of the following statements is true for a jagged array?
A. All rows have the same number of elements
B. All columns have the same number of elements
C. Rows can have different numbers of elements
D. It is a synonym for a 2D array
9. What is the purpose of a multidimensional array?
A. To store elements of different data types
B. To store elements of the same data type
C. To represent data in multiple dimensions
D. To perform complex calculations
10. In a 3D array, how many indices are used to access an element?
A. 1
B. 2
C. 3
D. 4
11. What is the default value of elements in an integer array in C++?
A. 0
B. 1
C. -1
D. Null
12. Which of the following is an example of a one-dimensional array?
A. int matrix[3][3];
B. float vector[10];
C. char table[2][2];
D. double array[];
13. What is the main advantage of using arrays in programming?
A. Dynamic memory allocation
B. Random access of elements
C. Linked structure
D. Recursive operations
14. What is the purpose of the size of an array?
A. To determine the number of elements in the array
B. To set the data type of the array
C. To define the array's dimension
D. To allocate memory for the array
15. Which of the following is not a valid array declaration in C?
A. int numbers[5] = {1, 2, 3, 4, 5};
B. float values[] = {1.0, 2.0, 3.0};
C. char letters[5] = {'a', 'b', 'c'};
D. double data[3] = {1, 2, 3, 4};
16. How is a two-dimensional array represented in memory?
A. As a single line of elements
B. As a matrix
C. As a linked list
D. As a tree structure
17. What is the purpose of initialising an array in programming?
A. To allocate memory
B. To set default values
C. To define the array's size
D. To create a dynamic array
18. Which operation is most efficient on an array?
A. Insertion in the middle
B. Deletion from the beginning
C. Searching for an element
D. Updating elements randomly
19. What is the size of an array in terms of memory consumption?
A. Size in bytes of one element multiplied by the number of elements
B. Size in kilobytes of one element
C. Size in bits of one element multiplied by the number of elements
D. Size in megabytes of one element
20. Which statement is true for a dynamic array?
A. Fixed size at runtime
B. Variable size at runtime
C. Only one-dimensional
D. No need for initialization
21. How do you find the length of an array in Python?
A. array.size()
B. len(array)
C. array.length()
D. size(array)
22. In Java, how do you declare a multidimensional array?
A. int[][] matrix;
B. int matrix[];
C. int matrix[] = new int[];
D. int matrix[][] = new int[];
23. What is a sparse array?
A. An array with many elements
B. An array with few non-zero elements
C. An array with all elements set to zero
D. An array with elements of different data types
24. Which of the following is an example of a multidimensional array?
A. int numbers[5];
B. float values[3][3];
C. char letters[] = {'a', 'b', 'c'};
D. double data[10];
25. What is the purpose of a null pointer in the context of arrays?
A. To point to the last element in the array
B. To indicate an uninitialized array
C. To represent a zero value in the array
D. To point to the first element in the array
26. Which of the following is true for a two-dimensional array in most programming
languages?
A. All rows must have the same number of elements
B. All columns must have the same number of elements
C. Rows can have different numbers of elements
D. Columns can have different numbers of elements
27. How is memory allocated for a two-dimensional array in C?
A. Contiguously for all elements
B. Separately for each row
C. In a linked list structure
D. Randomly
28. What is the purpose of the transpose of a matrix?
A. To switch rows and columns
B. To invert the matrix
C. To multiply the matrix by its inverse
D. To find the determinant
29. Which of the following is an example of a non-rectangular (ragged) array?
A. int matrix[3][3];
B. float vector[5];
C. char table[2][2];
D. int jaggedArray[][] = {{1,2}, {3,4,5}, {6}};
30. What is the disadvantage of using a large-sized array in terms of time complexity?
A. Slower access time
B. Faster search operations
C. Lower memory consumption
D. Reduced execution time
31. What is a linked list?
A. Linear data structure with fixed size
B. Non-linear data structure with variable size
C. Dynamic array
D. Static array
32. In a singly linked list, each node contains
A. Data and a pointer to the previous node
B. Data and a pointer to the next node
C. Only data
D. Only a pointer to the next node
33. What is the last node of a singly linked list pointing to?
A. Null
B. The first node
C. The middle node
D. The previous node
34. In a doubly linked list, each node contains
A. Data and a pointer to the previous node
B. Data and a pointer to the next node
C. Only data
D. Pointers to both the previous and next nodes
35. Which of the following is a disadvantage of a singly linked list?
A. Efficient memory usage
B. Easy insertion and deletion at the middle
C. Requires more memory
D. Supports reverse traversal
36. What is the advantage of a doubly linked list over a singly linked list?
A. Simplicity
B. Lower memory consumption
C. Efficient reverse traversal
D. Faster search operations
37. In a circular linked list, the last node points to
A. Null
B. The first node
C. The middle node
D. The previous node
38. What is the purpose of a dummy node in a linked list?
A. To store data
B. To point to the last node
C. To represent the middle node
D. To simplify boundary conditions
39. Which operation can be performed more efficiently in a linked list than in an
array?
A. Random access
B. Insertion and deletion at the beginning
C. Fixed size allocation
D. Sorting
40. What is the time complexity for searching an element in an unsorted linked list?
A. O(1)
B. O(log n)
C. O(n)
D. O(n^2)
41. How is memory allocated for a linked list in comparison to an array?
A. Contiguously
B. Randomly
C. Dynamically
D. Statically
42. Which type of linked list allows traversal in only one direction?
A. Singly linked list
B. Doubly linked list
C. Circular linked list
D. Dummy linked list
43. What is the purpose of the tail pointer in a linked list?
A. To store data
B. To point to the first node
C. To mark the end of the list
D. To simplify reverse traversal
44. How do you insert a node at the end of a singly linked list?
A. Update the head pointer
B. Traverse the list and update the next pointer of the last node
C. Create a new list
D. Delete the last node
45. Which type of linked list is useful for implementing a stack?
A. Singly linked list
B. Doubly linked list
C. Circular linked list
D. Dummy linked list
46. What is the purpose of a sentinel node in a linked list?
A. To store data
B. To mark the end of the list
C. To represent the middle node
D. To simplify boundary conditions
47. In a doubly linked list, how is the first node identified?
A. By a head pointer
B. By a tail pointer
C. By a dummy node
D. By a null pointer
48. Which operation is most efficient in a doubly linked list?
A. Insertion at the beginning
B. Deletion at the end
C. Searching for an element
D. Updating elements randomly
49. What is the advantage of using a circular linked list over a singly linked list?
A. Simplicity
B. Lower memory consumption
C. Efficient reverse traversal
D. Ability to traverse indefinitely
50. How does a circular linked list differ from a singly linked list?
A. The circular linked list has a dummy node
B. The circular linked list is always doubly linked
C. The last node in a circular linked list points to null
D. The last node in a circular linked list points to the first node
For more IT Mcqs please visit: www.iteagers.com
Computer MCQs - ITEagers
500+ Java Mcqs
500+ Networking Mcqs
500+ Operating System Mcqs
500+ Data Structure Mcqs
500+ MS Office Mcqs
500+ Database Mcqs
500+ PHP Mcqs
500+ Artificial Intelligence
500+ Python Mcqs
500+ C Language Mcqs
500+ C++ Mcqs
500+ SQL Server Mcqs
MySQL MCQs - ITEagers
Oracle Database MCQs - ITEagers
Digital Logic Design MCQs - ITEagers
Computer Organization and Architecture MCQs -
ITEagers
Data Mining MCQs - ITEagers
Machine Learning MCQs - ITEagers
For more General Mcqs please visit:
www.mcqstoday.com
500+ English Mcqs
500+ Maths Mcqs
500+ Science Mcqs
Pedagogy MCQS - MCQS TODAY
Social Studies MCQS - MCQS TODAY
Commerce MCQS - MCQS TODAY
Management MCQS - MCQS TODAY
Law MCQS - MCQS TODAY
Agriculture MCQS - MCQS TODAY
Sociology MCQS - MCQS TODAY
Political Science MCQS - MCQS TODAY
Microbiology MCQS - MCQS TODAY
Psychology MCQS - MCQS TODAY
Financial Accounting MCQS - MCQS TODAY

Contenu connexe

Similaire à Data Structure.pdf

Arrays In C Programming Explained
Arrays In C Programming ExplainedArrays In C Programming Explained
Arrays In C Programming ExplainedSimplilearn
 
C programming & data structure
C programming & data structureC programming & data structure
C programming & data structurerajeev_123
 
for sbi so Ds c c++ unix rdbms sql cn os
for sbi so   Ds c c++ unix rdbms sql cn osfor sbi so   Ds c c++ unix rdbms sql cn os
for sbi so Ds c c++ unix rdbms sql cn osalisha230390
 
Ds 111011055724-phpapp01
Ds 111011055724-phpapp01Ds 111011055724-phpapp01
Ds 111011055724-phpapp01Getachew Ganfur
 
Data structures question paper anna university
Data structures question paper anna universityData structures question paper anna university
Data structures question paper anna universitysangeethajames07
 
Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002SANTOSH RATH
 
AP PGECET Computer Science 2016 question paper
AP PGECET Computer Science 2016 question paperAP PGECET Computer Science 2016 question paper
AP PGECET Computer Science 2016 question paperEneutron
 
Std 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsStd 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsNuzhat Memon
 
Ds important questions
Ds important questionsDs important questions
Ds important questionsLavanyaJ28
 
300+ top data structures and algorithms mc qs pdf 2020
300+ top data structures and algorithms mc qs pdf 2020300+ top data structures and algorithms mc qs pdf 2020
300+ top data structures and algorithms mc qs pdf 2020tadeseguchi
 
Database Design Mid Term ExamSpring 2020Name ________________.docx
Database Design Mid Term ExamSpring 2020Name ________________.docxDatabase Design Mid Term ExamSpring 2020Name ________________.docx
Database Design Mid Term ExamSpring 2020Name ________________.docxwhittemorelucilla
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061gurbaxrawat
 
FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3Syahriha Ruslan
 
Course module of DS
Course module of DSCourse module of DS
Course module of DSPCTE
 

Similaire à Data Structure.pdf (20)

Data structure part 1
Data structure part  1Data structure part  1
Data structure part 1
 
Arrays In C Programming Explained
Arrays In C Programming ExplainedArrays In C Programming Explained
Arrays In C Programming Explained
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
 
C programming & data structure
C programming & data structureC programming & data structure
C programming & data structure
 
for sbi so Ds c c++ unix rdbms sql cn os
for sbi so   Ds c c++ unix rdbms sql cn osfor sbi so   Ds c c++ unix rdbms sql cn os
for sbi so Ds c c++ unix rdbms sql cn os
 
Ds 111011055724-phpapp01
Ds 111011055724-phpapp01Ds 111011055724-phpapp01
Ds 111011055724-phpapp01
 
Data structures question paper anna university
Data structures question paper anna universityData structures question paper anna university
Data structures question paper anna university
 
Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002
 
AP PGECET Computer Science 2016 question paper
AP PGECET Computer Science 2016 question paperAP PGECET Computer Science 2016 question paper
AP PGECET Computer Science 2016 question paper
 
Std 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsStd 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQs
 
Ds important questions
Ds important questionsDs important questions
Ds important questions
 
NET_Solved ans
NET_Solved ansNET_Solved ans
NET_Solved ans
 
300+ top data structures and algorithms mc qs pdf 2020
300+ top data structures and algorithms mc qs pdf 2020300+ top data structures and algorithms mc qs pdf 2020
300+ top data structures and algorithms mc qs pdf 2020
 
Database Design Mid Term ExamSpring 2020Name ________________.docx
Database Design Mid Term ExamSpring 2020Name ________________.docxDatabase Design Mid Term ExamSpring 2020Name ________________.docx
Database Design Mid Term ExamSpring 2020Name ________________.docx
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061
 
Arrays & Strings
Arrays & StringsArrays & Strings
Arrays & Strings
 
DS Q&A
DS Q&ADS Q&A
DS Q&A
 
FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3
 
Lesson 18-20.pptx
Lesson 18-20.pptxLesson 18-20.pptx
Lesson 18-20.pptx
 
Course module of DS
Course module of DSCourse module of DS
Course module of DS
 

Dernier

Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Pharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfPharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfBALASUNDARESAN M
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 

Dernier (20)

Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Pharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdfPharmaceutical Biotechnology VI semester.pdf
Pharmaceutical Biotechnology VI semester.pdf
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 

Data Structure.pdf

  • 1. DATA STRUCTURE - MCQs By www.iteagers.com - Visit for more Mcqs, Past Papers (SPSC/FPSC) and Quiz 1. What is an array? A. Data structure that stores elements of different data types B. Data structure that stores elements of the same data type C. A sorting algorithm D. A linear equation 2. In C++, the index of the first element in an array is A. 0 B. 1 C. -1 D. 10 3. What is the time complexity for accessing an element in an array? A. O(1) B. O(n) C. O(log n) D. O(n^2) 4. How do you declare a one-dimensional array in C? A. int array[10]; B. array[10] int; C. array int[10]; D. int[10] array; 5. What is the maximum number of dimensions an array can have in most programming languages? A. 1 B. 2 C. 3 D. 4 6. In a two-dimensional array, how is data stored in memory? A. Sequentially B. Diagonally C. In a tree structure D. Randomly
  • 2. 7. What is the syntax for accessing an element in a two-dimensional array in C++? A. array[row, column] B. array(row)(column) C. array[row][column] D. array(column, row) 8. Which of the following statements is true for a jagged array? A. All rows have the same number of elements B. All columns have the same number of elements C. Rows can have different numbers of elements D. It is a synonym for a 2D array 9. What is the purpose of a multidimensional array? A. To store elements of different data types B. To store elements of the same data type C. To represent data in multiple dimensions D. To perform complex calculations 10. In a 3D array, how many indices are used to access an element? A. 1 B. 2 C. 3 D. 4 11. What is the default value of elements in an integer array in C++? A. 0 B. 1 C. -1 D. Null 12. Which of the following is an example of a one-dimensional array? A. int matrix[3][3]; B. float vector[10]; C. char table[2][2]; D. double array[]; 13. What is the main advantage of using arrays in programming? A. Dynamic memory allocation B. Random access of elements C. Linked structure D. Recursive operations 14. What is the purpose of the size of an array?
  • 3. A. To determine the number of elements in the array B. To set the data type of the array C. To define the array's dimension D. To allocate memory for the array 15. Which of the following is not a valid array declaration in C? A. int numbers[5] = {1, 2, 3, 4, 5}; B. float values[] = {1.0, 2.0, 3.0}; C. char letters[5] = {'a', 'b', 'c'}; D. double data[3] = {1, 2, 3, 4}; 16. How is a two-dimensional array represented in memory? A. As a single line of elements B. As a matrix C. As a linked list D. As a tree structure 17. What is the purpose of initialising an array in programming? A. To allocate memory B. To set default values C. To define the array's size D. To create a dynamic array 18. Which operation is most efficient on an array? A. Insertion in the middle B. Deletion from the beginning C. Searching for an element D. Updating elements randomly 19. What is the size of an array in terms of memory consumption? A. Size in bytes of one element multiplied by the number of elements B. Size in kilobytes of one element C. Size in bits of one element multiplied by the number of elements D. Size in megabytes of one element 20. Which statement is true for a dynamic array? A. Fixed size at runtime B. Variable size at runtime C. Only one-dimensional D. No need for initialization 21. How do you find the length of an array in Python? A. array.size() B. len(array)
  • 4. C. array.length() D. size(array) 22. In Java, how do you declare a multidimensional array? A. int[][] matrix; B. int matrix[]; C. int matrix[] = new int[]; D. int matrix[][] = new int[]; 23. What is a sparse array? A. An array with many elements B. An array with few non-zero elements C. An array with all elements set to zero D. An array with elements of different data types 24. Which of the following is an example of a multidimensional array? A. int numbers[5]; B. float values[3][3]; C. char letters[] = {'a', 'b', 'c'}; D. double data[10]; 25. What is the purpose of a null pointer in the context of arrays? A. To point to the last element in the array B. To indicate an uninitialized array C. To represent a zero value in the array D. To point to the first element in the array 26. Which of the following is true for a two-dimensional array in most programming languages? A. All rows must have the same number of elements B. All columns must have the same number of elements C. Rows can have different numbers of elements D. Columns can have different numbers of elements 27. How is memory allocated for a two-dimensional array in C? A. Contiguously for all elements B. Separately for each row C. In a linked list structure D. Randomly 28. What is the purpose of the transpose of a matrix? A. To switch rows and columns B. To invert the matrix C. To multiply the matrix by its inverse
  • 5. D. To find the determinant 29. Which of the following is an example of a non-rectangular (ragged) array? A. int matrix[3][3]; B. float vector[5]; C. char table[2][2]; D. int jaggedArray[][] = {{1,2}, {3,4,5}, {6}}; 30. What is the disadvantage of using a large-sized array in terms of time complexity? A. Slower access time B. Faster search operations C. Lower memory consumption D. Reduced execution time 31. What is a linked list? A. Linear data structure with fixed size B. Non-linear data structure with variable size C. Dynamic array D. Static array 32. In a singly linked list, each node contains A. Data and a pointer to the previous node B. Data and a pointer to the next node C. Only data D. Only a pointer to the next node 33. What is the last node of a singly linked list pointing to? A. Null B. The first node C. The middle node D. The previous node 34. In a doubly linked list, each node contains A. Data and a pointer to the previous node B. Data and a pointer to the next node C. Only data D. Pointers to both the previous and next nodes 35. Which of the following is a disadvantage of a singly linked list? A. Efficient memory usage B. Easy insertion and deletion at the middle C. Requires more memory D. Supports reverse traversal
  • 6. 36. What is the advantage of a doubly linked list over a singly linked list? A. Simplicity B. Lower memory consumption C. Efficient reverse traversal D. Faster search operations 37. In a circular linked list, the last node points to A. Null B. The first node C. The middle node D. The previous node 38. What is the purpose of a dummy node in a linked list? A. To store data B. To point to the last node C. To represent the middle node D. To simplify boundary conditions 39. Which operation can be performed more efficiently in a linked list than in an array? A. Random access B. Insertion and deletion at the beginning C. Fixed size allocation D. Sorting 40. What is the time complexity for searching an element in an unsorted linked list? A. O(1) B. O(log n) C. O(n) D. O(n^2) 41. How is memory allocated for a linked list in comparison to an array? A. Contiguously B. Randomly C. Dynamically D. Statically 42. Which type of linked list allows traversal in only one direction? A. Singly linked list B. Doubly linked list C. Circular linked list D. Dummy linked list 43. What is the purpose of the tail pointer in a linked list?
  • 7. A. To store data B. To point to the first node C. To mark the end of the list D. To simplify reverse traversal 44. How do you insert a node at the end of a singly linked list? A. Update the head pointer B. Traverse the list and update the next pointer of the last node C. Create a new list D. Delete the last node 45. Which type of linked list is useful for implementing a stack? A. Singly linked list B. Doubly linked list C. Circular linked list D. Dummy linked list 46. What is the purpose of a sentinel node in a linked list? A. To store data B. To mark the end of the list C. To represent the middle node D. To simplify boundary conditions 47. In a doubly linked list, how is the first node identified? A. By a head pointer B. By a tail pointer C. By a dummy node D. By a null pointer 48. Which operation is most efficient in a doubly linked list? A. Insertion at the beginning B. Deletion at the end C. Searching for an element D. Updating elements randomly 49. What is the advantage of using a circular linked list over a singly linked list? A. Simplicity B. Lower memory consumption C. Efficient reverse traversal D. Ability to traverse indefinitely 50. How does a circular linked list differ from a singly linked list? A. The circular linked list has a dummy node B. The circular linked list is always doubly linked
  • 8. C. The last node in a circular linked list points to null D. The last node in a circular linked list points to the first node For more IT Mcqs please visit: www.iteagers.com Computer MCQs - ITEagers 500+ Java Mcqs 500+ Networking Mcqs 500+ Operating System Mcqs 500+ Data Structure Mcqs 500+ MS Office Mcqs 500+ Database Mcqs 500+ PHP Mcqs 500+ Artificial Intelligence 500+ Python Mcqs 500+ C Language Mcqs 500+ C++ Mcqs 500+ SQL Server Mcqs MySQL MCQs - ITEagers Oracle Database MCQs - ITEagers Digital Logic Design MCQs - ITEagers Computer Organization and Architecture MCQs - ITEagers Data Mining MCQs - ITEagers Machine Learning MCQs - ITEagers For more General Mcqs please visit: www.mcqstoday.com 500+ English Mcqs 500+ Maths Mcqs 500+ Science Mcqs Pedagogy MCQS - MCQS TODAY Social Studies MCQS - MCQS TODAY Commerce MCQS - MCQS TODAY Management MCQS - MCQS TODAY Law MCQS - MCQS TODAY
  • 9. Agriculture MCQS - MCQS TODAY Sociology MCQS - MCQS TODAY Political Science MCQS - MCQS TODAY Microbiology MCQS - MCQS TODAY Psychology MCQS - MCQS TODAY Financial Accounting MCQS - MCQS TODAY