
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
42 questions
Miterm Exam in CC123C - BSIT1J

Quiz
•
University
40 questions
Trivia(Explore in depth)

Quiz
•
University
34 questions
Data structures: Chapter 2| 1

Quiz
•
University
40 questions
Playing Code!

Quiz
•
University
42 questions
Data Structures and Algorithms Quiz

Quiz
•
University
44 questions
UTS IF X - GENAP

Quiz
•
12th Grade - University
40 questions
Array of Structures 2

Quiz
•
University
35 questions
One Dimensional Array

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University