Skip to content
Repl icon
BigO Exercise 1
aneagoie
aneagoie
Published on May 29, 2022
This repl has no description
More repls
HyperPaint BETA
HyperPaint BETA
HyperAlternative
HyperAlternative
Welcome To HyperPaint BETA Have an idea of what to paint but don't have a place to paint it? You've come to the right place. Save Paintings Save Custom Colors
#games
+3
ColdChat Client (chat app)
ColdChat Client (chat app)chat app in node.js using socket.io I've made many chat apps previously but I got inspiration for a simplistic-looking, console-based one from the previously trending "ctrl chat" (by @blockowo). I felt bad about its many serious security flaws and literally zero validation. Seeing it get destroyed by exploiters made me want to start working on a secure chat app with validation, backend word filters, powerful anti-spam, and a proper account system. So far I've only made the basic security infrastructure and a simple layout, plus a powerful anti spam. This of course isn't finished and there are PLENTY of updates planned and coming soon.
Evolution
EvolutionSimulate evolution by selecting for certain criteria! This simulation tries to replicate evolution by simulating movements of little creatures named "cells". A small pet project by IcemasterEric, this turned out to work extremely well!
1413comments
RongZheng
RongZheng5 months ago

O(n)

deeppradhan
deeppradhan5 months ago

O(n)

the0bit
the0bit5 months ago

It is O(n) because of one simple loop over the elements of the input

PawleN
PawleN5 months ago

O(n) - we have to loop through the input which can be of any size or length

RyanYoon4
RyanYoon45 months ago

man this website sucks for not having ability to close comments. ruined my attempt to solve the exercise

SalmanAnsari6
SalmanAnsari65 months ago

O(n)

We have to run code in each items of an array

RuProgrammer
RuProgrammer5 months ago

He should’ve closed comments because of idiots like you spamming comments with a solution

kapiljoshi1
kapiljoshi15 months ago

O(n) * time complexity of anotherFunction

Sayalikatkar
Sayalikatkar5 months ago

O(n*time complexity of anotherFunction)

JalayRupera
JalayRupera5 months ago

O(n) n = length of an array

DanielNolan2
DanielNolan25 months ago

O(n)

DevRudra
DevRudra5 months ago

O(n)

MaqsudTolipov
MaqsudTolipov5 months ago

O(n)

kapilavai1
kapilavai15 months ago

O(n)

yani82
yani825 months ago

O(n)

mingximacie
mingximacie5 months ago

one loop: O(n) * Time of anotherFunctions

rahul786
rahul7865 months ago

O(n)

RuchitMotiwala
RuchitMotiwala5 months ago

O(n)

KaijieWan
KaijieWan5 months ago

O(n * number of operations/runtime in anotherFunction), linear time since function ends only after running through every iteration so runtime depends on size of input and also anotherFunction

MohammedContrac
MohammedContrac5 months ago

O (n * Time-complexity of anotherFunction)

RikamPalkar
RikamPalkar5 months ago

Simply, O(n).

ArushiKapurwan
ArushiKapurwan5 months ago

O(n* order of time-complexity of anotherFunction)

UWEMNKEREUWEM
UWEMNKEREUWEM5 months ago

O(n) * (runtime of anotherFunction)

l_qd
l_qd5 months ago

O(n)

ravikiran37
ravikiran375 months ago

O(n * order of anotherFunction())

swsd2544
swsd25445 months ago

O(n) If anotherFunction runtime is O(1), else it would be O(n * runtime of anotherFunction).

rinkusam12
rinkusam125 months ago

O(n)

mahi6878
mahi68785 months ago

O(n) The function is executed for all the input elements till it reaches the last element.

Reacher
Reacher5 months ago

The function is O(n).

moonty4790
moonty47905 months ago

O(n) linear time

However, we don't know what the function contains otherfunction ();

UchechukwuEmman
UchechukwuEmman5 months ago

O(n)

ShubhamBhardw15
ShubhamBhardw155 months ago

O(n) Due to N number of times loop is being run.

milindaldonkar
milindaldonkar5 months ago

O(n)

LLJJ2001
LLJJ20015 months ago

O(n)

anukrati2000
anukrati20005 months ago

O(n)

DavideLepri1
DavideLepri15 months ago

O(n)

Tim-fx
Tim-fx5 months ago

O(n)

OjedejiOluwatob
OjedejiOluwatob5 months ago

O(n)

pecostef
pecostef5 months ago

Since "anotherFunction" function does not accept any input (hence does not depend on "input"), the overall asymptotic complexity is O(n)

Madhura194
Madhura1945 months ago

O(n)

PauloAntonio1
PauloAntonio15 months ago

O(n)

kavitamahar
kavitamahar5 months ago

O(n)

Amrelsherif7
Amrelsherif75 months ago

O(n) where n is the length of the input

huuhou48
huuhou485 months ago

O(n)

Ceng318
Ceng3185 months ago

O(n) because loop will keep executing based on the length or size of input.

norbeqr89
norbeqr895 months ago

O(N) - the function increase based on the input data

kartiwatt
kartiwatt5 months ago

O(n) as for loop depends on the number of inputs.

sheldonO
sheldonO5 months ago

O(n)

arao92
arao925 months ago

O(N) - Number of operation linearly increases based on input length

tarantula77
tarantula775 months ago

O(n) because call to function is linear to the input array size.

AnastassiyaM
AnastassiyaM5 months ago

O(n) because it goes through the loop

pushpalika
pushpalika6 months ago

O(n)

narasimhakamath
narasimhakamath6 months ago

O(n) assuming that anotherFunction() has a linear time complexity.

prabhakarkaraja
prabhakarkaraja6 months ago

O(n)

Nacht-33
Nacht-336 months ago

O(n) imo

ObulPathi
ObulPathi6 months ago

O(nxm) --> where m is time complexity of anotherfunctions().

ghulamilyas
ghulamilyas6 months ago

o(n)

i-am-notorious
i-am-notorious6 months ago

O(n^n) bcoz another function is called for every iteration.

rabira-hierpa
rabira-hierpa6 months ago

O(n * x) since we don't know the operation that is performed under anotherFunction()

Pradhan1999
Pradhan19996 months ago

The big O of the function is O(n)

JosueValverde
JosueValverde6 months ago

O(n)

gastonkons
gastonkons6 months ago

O(n)

sumanthjoel
sumanthjoel6 months ago

O(n)

Aditya1114
Aditya11146 months ago

O(n)

YashKaushik3
YashKaushik36 months ago

0(n)

HarshaMadhwani
HarshaMadhwani6 months ago

o(n)

yingweiliu
yingweiliu6 months ago

o(n)

ShacharBartal
ShacharBartal6 months ago

unkown since we don't know the otherFunction big o, but we do know that O would be at least O(n) since there is a loop with N iterations.

SameerJoshi4
SameerJoshi46 months ago

O(n)

bunnyBites
bunnyBites6 months ago

Okay, so when I run the code it shows that anotherFunction is not declared:(. So, the function performs O(2) since it performs two operations every time (line 3 and line 4). So, it is considered to be "O(1)" as its a constant. :)

EmmaPrecious
EmmaPrecious6 months ago

O(n) because as the input increases the addition of a increases

EmmaPrecious
EmmaPrecious6 months ago

O(n)

amruthas4
amruthas46 months ago

O(n)

AjmalNasumudeen
AjmalNasumudeen6 months ago

O(n)

AravindBhuvanen
AravindBhuvanen6 months ago

O(n)

Mrunal-13
Mrunal-136 months ago

o(n)

ILORIAbdrasheed
ILORIAbdrasheed6 months ago

O(1) because the function is not called so it wont execute

jomefavourite
jomefavourite6 months ago

O(n)

Because thats the biggest time complexity there

PeterSedlacek
PeterSedlacek6 months ago

O(n * k) - k is anotherFunction`s running time

anhthiencao
anhthiencao6 months ago

O(n)

VishalJha5
VishalJha56 months ago

O(N)

A1denn
A1denn6 months ago

O(n)

ithebk
ithebk6 months ago

Big O, depends anotherFuntions() also.. Let's say if anotherFunctions takes constant time then: O(n)

rajdeepti19
rajdeepti196 months ago

Big O of the function is O(n) as it's a linear time complexity. It goes on increasing linearly as the size of input increases.

VenkateswarUpad
VenkateswarUpad6 months ago

O(n) is the Big O of the above function

FredSharapov
FredSharapov6 months ago

O(n) - Linear time complexity because it depends on the array size of the 'input' parameter.

bellsraafi
bellsraafi6 months ago

O(n)

PraveenPraveen4
PraveenPraveen46 months ago

Linear time complexity O(n)

umairnazeer
umairnazeer6 months ago

O(n)

shchye95
shchye956 months ago

O(n)

salman1204
salman12046 months ago

The number of operations "FunChanllenge()" depends on the parameter 'input' array's size. Because there is loop inside the FunChanllenge() which operates the number of time based on the 'input' array's size. The number of input array's element increase, the number of the operation will increase.

so, the time complexity is O(n).

OluwatosinSolar
OluwatosinSolar6 months ago

O(n)

OluwatosinSolar
OluwatosinSolar6 months ago

Big O calculates how an algorithm slows down as inputs grow, or the number of operations to be carried out as input of an algorithm grows.

0(n) is linear inputs === operations O(1) is constant inputs === 1 operation

RodeAjinkya
RodeAjinkya6 months ago

O(n * k) where K is time for running anotherFunction()

SubTiLiZeR31
SubTiLiZeR316 months ago

O(n)

luisangel2895
luisangel28956 months ago

Lineal 0(n)

UchennaMba
UchennaMba6 months ago

O(n)

MAHMUD9
MAHMUD96 months ago

O(n)

sibsankarmanna
sibsankarmanna6 months ago

its time complexity is O(n)=O(1)+O(1)+O(n)+nO(1)+nO(n)=O(n)

copbrick
copbrick6 months ago

O(n) as the loop increases iterations based on the constant passed in the parameter.