What is the time complexity of appending an element to a list in Python?

Python Data Structures and Algorithms Quiz

Quiz
•
Computers
•
Professional Development
•
Hard
nature mind
Used 1+ times
FREE Resource
41 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
O(1)
O(log n)
O(n)
O(n²)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? def mystery_function(arr): return [x**2 for x in arr if x % 2 == 0] print(mystery_function([1, 2, 3, 4, 5]))
[1, 4, 9, 16, 25]
[4, 16]
[2, 4]
None
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the space complexity of a recursive function?
O(1)
O(n)
O(n log n)
O(log n)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which data structure follows First In, First Out (FIFO)?
Stack
Queue
Array
Linked List
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? def find_duplicates(arr): return len(arr) != len(set(arr)) print(find_duplicates([1, 2, 3, 4, 1]))
True
False
[1, 2, 3, 4]
[1]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true for a binary search?
The list must be unsorted
The list must be sorted
The list can be unsorted or sorted
The list can only contain negative integers
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the space complexity of merging two sorted arrays of size n?
O(1)
O(n)
O(2n)
O(log n)
Create a free account and access millions of resources
Similar Resources on Wayground
41 questions
C Programming Quiz

Quiz
•
Professional Development
36 questions
unit 8 Review csa test

Quiz
•
Professional Development
40 questions
Siema

Quiz
•
Professional Development
41 questions
Stack overview

Quiz
•
Professional Development
38 questions
গ্রাফিক্স ডিজাইন কুইজ

Quiz
•
Professional Development
40 questions
HTML CSS JS Teacher Assessment

Quiz
•
Professional Development
40 questions
Applications of DMS in A.I AND GATE/JNTUH/NPTEL/PLACEMENTS probl

Quiz
•
Professional Development
41 questions
UPUP

Quiz
•
Professional Development
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade