Tech quiz-july

Quiz
•
Other
•
University
•
Medium
NIKHILA RS
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
What is the time and space complexity to delete a node from the singly linked list?
Time complexity: O(1), Space complexity: O(1)
Time complexity: O(1), Space complexity: O(n)
Time complexity: O(n), Space complexity: O(1)
Time complexity: O(n), Space complexity: O(n)
Answer explanation
option(c) :Time complexity: O(n), Space complexity: O(1) Explanation. To search for the node, we need to traverse the full linked list; hence time complexity will be O(n), and space complexity will be O(1). As to keep track, we only require a temp variable.
2.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
How many edges are present in the complete graph of n vertices?
n(n-1)/2
n(n+1)/2
n
n/2
Answer explanation
Ans. (a) n(n-1)/2 Explanation. n complete graph, all the edges are connected to each other; hence the maximum number of edges is calculated by nC2, which is equal to n(n-1)/2.
3.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
What is the cost of searching for an AVL tree?
O(n)
O(log (n))
O(n*n)
O(n*log(n))
Answer explanation
Ans. (b) O(log(n)) Explanation. AVL tree is a balanced tree. First, we check the current node value and then recur the left or right subtree accordingly. The number of comparisons is limited by height n; the time complexity is O(log(n)).
4.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
When was C programming invented?
1987
1967
1997
1977
5.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
What is the output of the following code?
def func(x=[]):
x.append(1)
return x
print(func())
print(func())
[1] [1]
[1] [1, 1]
[1, 1] [1, 1]
[1] [1] [1] [1]
6.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
What will be the output of the following code
1 2 3 4 5
1 2 3 4
2 3 4 5
5 4 3 2 1
7.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
The complexity of linear search algorithm is___
0(n)
0(log n)
0(n2)
0(n log n)
Answer explanation
explanation: the worst case complexity of linear search is 0(n)
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Florida Pert Review

Quiz
•
9th Grade - University
21 questions
Software Engineering Basics

Quiz
•
University
25 questions
C Programming

Quiz
•
12th Grade - University
20 questions
Reimann Sum

Quiz
•
10th Grade - University
16 questions
FMSF86/FMSF90 Statistical learning

Quiz
•
University
20 questions
LAW OF CONSERVATION OF ENERGY

Quiz
•
University
20 questions
CODE CRAFT

Quiz
•
University
20 questions
Lecture SIX.

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 Other
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