DSA Quiz (25-09-2023)

1.) What is the worst case time complexity?
a.) O(n)
b.) O(1)
c ) O(logn)
d.) O(nlogn)

2.) What is the best case time complexity?
a.) O(n)
b.) O(1)
c ) O(logn)
d.) O(nlogn)

3.) What is the syntax of replace?
a.) variable name ( element to replace , with what to replace)
b ) ( element to replace , with what to replace)
c.) variable name.replace ( element to replace , with what to replace)
d.) None of above

4.) If element is not present in slicing, will it throw a error ?
list1 = [1,2,3,4,5,6,7]
print(list1[:8:])

a.) yes
b.) no

5.) If element is not present in indexing, will it throw a error ?
list1 = [1,2,3,4,5,6,7]
print(list1[8])

a.) yes
b.) no

  1. d
  2. b
  3. c
  4. b
  5. a
1 Like

1.d
2.b
3.c
4.b
5.a

.

1 Like
  1. d.) O(nlogn)
  2. b.) O(1)
  3. c.) variable_name.replace(element_to_replace, with_what_to_replace)
  4. b.) no
  5. a.) yes
1 Like

Amazing guys , Keep practicing

  1. D - O(nlogn)
  2. B - O(1)
  3. C - variable name.replace ( element to replace , with what to replace)
  4. B - no
  5. A - yes
1 Like

correct @shibuna1205