
MidExam- Data Structures and Algorithms

Quiz
•
Computers
•
University
•
Hard
Aileen Torre
Used 1+ times
FREE Resource
39 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly initializes an integer array in C#?
int[] numbers = {1, 2, 3};
int[] numbers = new Array(3);
int[] numbers = new int[3]{1, 2, 3, 4};
int numbers = {1, 2, 3};
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you access the first element of an array named data in C#?
data[0]
data(1)
data.First()
data.[1]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following code, what is the output?
int[] arr = {10, 20, 30};
Console.WriteLine(arr.Length);
2
3
30
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does a multidimensional array differ from a jagged array in C#?
Multidimensional arrays are rectangular, jagged arrays are triangular
Jagged arrays use [,] notation while multidimensional arrays use [][]
Jagged arrays are arrays of arrays, multidimensional arrays are a grid-like structure
There is no difference
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following code?
int[,] matrix = new int[2, 2] {{1, 2}, {3, 4}};
Console.WriteLine(matrix[1, 1]);
1
2
3
4
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to iterate over all elements in a C# array?
foreach (var item in array)
for (item in array)
while (array hasNext)
repeat array
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for declaring a multidimensional array in C#?
int array[2, 3];
int array[,] = new int[2, 3];
int array[2][3];
int[,] array = new int[2, 3];
Create a free account and access millions of resources
Similar Resources on Wayground
43 questions
Data Structure and Algorithm

Quiz
•
University
40 questions
Quizz PTS Kelas XI Struktur Data Array

Quiz
•
11th Grade - University
40 questions
Tema 6 Programación Básica

Quiz
•
University
35 questions
Kuis 2

Quiz
•
University
44 questions
Round 1 Code2duo

Quiz
•
University
34 questions
Java Quiz

Quiz
•
11th Grade - University
40 questions
A4ALGU CLUB EVENT QUIZ

Quiz
•
University
40 questions
Coding Skill Test -I

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade