BaşlayınÜcretsiz Başlayın

Practicing with Big O Notation

In this exercise, you will keep practicing your understanding of Big O notation.

In the first step, you will create an algorithm that prints all the elements of the following list:

colors = ['green', 'yellow', 'blue', 'pink']

The algorithm will have an \(O(n)\) complexity.

In the second and third steps, you will calculate the complexity of two algorithms.

Bu egzersiz

Data Structures and Algorithms in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

colors = ['green', 'yellow', 'blue', 'pink']

def linear(colors):
  # Iterate the elements of the list
  ____:
    # Print the current element of the list
    print(____)	

linear(colors)
Kodu Düzenle ve Çalıştır