SlideShare une entreprise Scribd logo
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

Data structure part 1
Data structure part  1Data structure part  1
Data structure part 1
Knowledge Center Computer
 
Arrays In C Programming Explained
Arrays In C Programming ExplainedArrays In C Programming Explained
Arrays In C Programming Explained
Simplilearn
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
RamKumar42580
 
C programming & data structure
C programming & data structureC programming & data structure
C programming & data structure
rajeev_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 os
alisha230390
 
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 paper
Eneutron
 
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
Nuzhat Memon
 
Ds important questions
Ds important questionsDs important questions
Ds important questions
LavanyaJ28
 
NET_Solved ans
NET_Solved ansNET_Solved ans
NET_Solved ans
Farhana Sathath
 
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
tadeseguchi
 
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
whittemorelucilla
 
Model question paper_mc0061
Model question paper_mc0061Model question paper_mc0061
Model question paper_mc0061
gurbaxrawat
 
Arrays & Strings
Arrays & StringsArrays & Strings
Arrays & Strings
Munazza-Mah-Jabeen
 
DS Q&A
DS Q&ADS Q&A
DS Q&A
zzzubair
 
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
Syahriha Ruslan
 
Lesson 18-20.pptx
Lesson 18-20.pptxLesson 18-20.pptx
Lesson 18-20.pptx
MIZANURRAHMANTUSHAR1
 
Course module of DS
Course module of DSCourse module of DS
Course module of DS
PCTE
 

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

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Reflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPointReflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPoint
amberjdewit93
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
MERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDFMERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDF
scholarhattraining
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 

Dernier (20)

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Reflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPointReflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPoint
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
MERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDFMERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDF
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 

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