
DS QUIZ-1
Authored by Ms.N.Deepika - PSG CT
Computers
University

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
1. Which of the following is the correct way to initialize a 2D array of size 2x3 with all elements set to 0 in C?
A) int arr[2][3] = {0};
B) int arr[2][3] = {1};
int arr[2][3] = {0, 1, 2, 3, 4};
D) int arr[2][3] = {0, 0, 0};
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
2. Given an array of integers, what is the best approach to find the largest element in the array?
A) Use a binary search algorithm.
B) Traverse the array once, keeping track of the largest element found.
C) Sort the array and select the last element.
D) Use a hash table to store and find the largest element.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
3. You are given an array containing n integers, where each integer is between 1 and n+1. One integer is missing. What is the time complexity to find the missing integer?
3. You are given an array containing n integers, where each integer is between 1 and n+1. One integer is missing. What is the time complexity to find the missing integer?
A) O(n)
B) O(n log n)
C) O(1)
D) O(n^2)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
4. Which advantage does a linked list have over an array when dealing with dynamic data sizes?
A) Linked lists have better cache performance.
B) Linked lists use less memory per element.
C) Linked lists can grow and shrink in size more efficiently without resizing or reallocating.
D) Linked lists offer constant time access to elements.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
5. What is the time complexity of merging two sorted singly linked lists into a single sorted linked list?
A) O(n + m)
B) O(n * m)
C) O(n)
D) O(m)
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
6. What is the optimal approach to swap every two adjacent nodes in a singly linked list?
A) Use a stack to store nodes and swap adjacent nodes.
B) Use a dummy node and swap pairs iteratively.
C) Reverse the entire list and then swap adjacent nodes.
D) Use a recursive function to swap nodes in pairs.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
7. Inserting a new node before a given node temp in a doubly linked list involves which of the following steps?
A) Update temp->prev->next to point to the new node, set newNode->prev to temp->prev, and newNode->next to temp.
B) Update temp->prev->next to point to the new node, set newNode->prev to temp, and newNode->next to temp->next.
C) Set newNode->prev to temp->prev, newNode->next to temp, and update temp->prev and temp->next.
D) Set newNode->prev to temp->prev, newNode->next to temp, and update temp->prev and temp->next
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Software Testing
Quiz
•
University
15 questions
HTML Quiz
Quiz
•
11th Grade - University
10 questions
Hệ Điều Hành Của Máy Tính
Quiz
•
10th Grade - University
10 questions
C++ Array Quiz
Quiz
•
University
15 questions
Computer Applications in Banking and Finance Quiz
Quiz
•
University
10 questions
Node.js
Quiz
•
University
15 questions
Mikropemproses dan Mikropengawal
Quiz
•
12th Grade - University
10 questions
PHP Introduction - Assignment 1
Quiz
•
University
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University