[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

My homework

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 27
Thread images: 11

File: lalalal.png (57KB, 515x543px) Image search: [Google]
lalalal.png
57KB, 515x543px
Does anyone want to do my homework?
>>
no
kys
>>
File: suicidio.jpg (21KB, 665x500px) Image search: [Google]
suicidio.jpg
21KB, 665x500px
ok
>>
>>58681373
The answer is 2.
>>
File: lalalal.jpg (33KB, 1260x838px) Image search: [Google]
lalalal.jpg
33KB, 1260x838px
meeeeeeeh :( tempting
>>
>>58681373
i finished your homework seconds ago.
definitly wasted to much time at 5
>>
KKKKKKKKKKKKK
>>
File: 1480802415419.jpg (122KB, 457x459px) Image search: [Google]
1480802415419.jpg
122KB, 457x459px
>>58681373
>>
>>58681373
Make j= i+1 on initialization, and make I go to A.length -1. (This prevents out of bounds indexing)
>>
File: pram.png (428KB, 656x371px) Image search: [Google]
pram.png
428KB, 656x371px
Fuck
>>
It literally tells you how to do it

That's some next level laziness
>>
>>58682592

True. Not that it matters much OP, but you could also return early if you found a duplicate:

public static boolean hasDuplicates(int []A){
for (int i=0;i<A.length;i++)
for (int j=i+1;j<A.length;j++)
if(A[i]==A[j])
return true;
return false;
}

In the worst case you still got
(n-1) + (n-2) + ... + 0 = n*(n-1)/2
inner loops though, so the algorithm is still quadratic. You also got n outer loops.
>>
File: nooooo.gif (23KB, 308x331px) Image search: [Google]
nooooo.gif
23KB, 308x331px
:(
>>
public static boolean hasDuplicates(int []A){
int len = A.length
for (int i=0;i<len-1;i++)
for (int j=i+1;j<len;j++)
if (A[i]==A[j])
return true;
return false;
}
>>
File: 1479868300617.jpg (37KB, 400x386px) Image search: [Google]
1479868300617.jpg
37KB, 400x386px
>>58681373
>mergesort
>>
>>58681373
Wish I knew how to code
But all I do is build pc's and have a tiny penis
>>
>>58681373
BLANKITY
BLANKITY
BLANK
>>
File: ii.jpg (70KB, 414x610px) Image search: [Google]
ii.jpg
70KB, 414x610px
Fuck it
>>
sdikdsififjvihond fhifvuv ujbdf ufd udf uiofjif vijf dijdf ijfd n
>>
>>58681373
do your own homework fag or you wont pass the test
>>
>>58681373
> Continue the for loops even when the result is determined.

Your teacher is a retard. Sorry senpai
>>
>>58681373
>literally can't do job interview questions
Change majors.
>>
You can find pajeets on Reddit that will charge you like 3 bucks to do simple shit like this.
If you're retarded but forced to stay in college/highschool for whatever reason (parents pressure, etc.) it might be worth it to find a pajeet willing to work long term for you. They might even give you a discount.
>>
>>58681373
How in the world do you expect to make it through this whole major if you can't be bothered to do intro material? Man up.
>>
If you can't handle something of this level, consider Women's studies.
>>
File: p.gif (74KB, 460x307px) Image search: [Google]
p.gif
74KB, 460x307px
I'm a potato
>>
Use a hash set and you won't need to worry about going o(n^2)
Thread posts: 27
Thread images: 11


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.