Super-Efficient!

A program can have an efficiency of O ( 1 ) O(1) .

True or False?

False True

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

1
2
3
## A program which returns first element of a list.
def getFirstElement(li):
     return(li[0])

Steven Chase
Dec 23, 2016

I guess "Hello World" would be an example as well

i dont understand 0(1) i mean its not a qubit its 1 or 0, its like curreny is going through an transistor or is not going through an transitor

Trash of Bros - 3 years, 5 months ago

there is no middle ground, people invented so many things around 1(i hope i dont make a stupid mistake) their is currency or 0 there is no currency

Trash of Bros - 3 years, 5 months ago

Log in to reply

We're not talking about binary symbols here. We're talking about how computational complexity scales with the size of a problem. For example, consider the Traveling Salesman problem with N cities. The computational complexity scales as the something like the factorial of N. But instead, suppose the salesman only had to visit the first city, regardless of how many cities there were. Then the computational complexity would be static (O(1)), and independent of N.

Steven Chase - 3 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...