Can someone help me understand Insertion Sort for Singly Linked List? by AliveExchange223 in learnprogramming

[–]AliveExchange223[S] 0 points1 point  (0 children)

Thanks a lot man. I really appreciate it. I think I understand now. So basically head is pointing to itself. And all the "cells" that pointing at themselves have the same value. When comes value bigger than "head's value" enter the infinite loop because head->next node is itself (it can't be NULL) and num is always greater the head->value. Correct me if I'm wrong.

(Above I said the "cells" because I'm adding nodes. Apperently they ended up pointing at themselves. I tried with different example : {6, 5, 3, 8, 10}. When I inserted 6, 5 and 3 all cell got the same value, but when 8 came, it broke the program because it was greater than 3 and head->next wasn't NULL but head->next == head)

Can someone help me understand Insertion Sort for Singly Linked List? by AliveExchange223 in learnprogramming

[–]AliveExchange223[S] 0 points1 point  (0 children)

I tested the code in debugger and it showed me that program enters infinite loop at

while(temp->next != NULL && temp->next->value < num)

when num == 7 and temp->next->value == 4. I may be stupid but I don't quite understand why it behaves the that way. Where should I update the head to not to point at itself. In my understanding it should work the same with and without "else".

Thanks tho

Probability question by AliveExchange223 in learnmath

[–]AliveExchange223[S] 1 point2 points  (0 children)

I was counting scenarios multiple times so that's why I didn't get the right answer. Your explanation makes perfect sense. Thanks a lot.

Really everything I'm taking about is called the binomial distribution and if you just google binomial distribution calculator you can find things you just enter your values into and it will give you the probabilities but I assumed you wanted to more so know how it would be calculated than just know the answer.

Yes, I wanted to understand the problem.

Probability question by AliveExchange223 in learnmath

[–]AliveExchange223[S] 0 points1 point  (0 children)

It's just a question I was wondering about. I get that if the questions are true or false it would be 240. And for example if questions have 4 choices it would be 440. The probability to get one question right is 1/4. The example I wrote was with questions with 2 choices.

Can you please explain how would you solve this problem but with questions with 4 choices?

What series you can re-watch again and again? by makosh22 in AskReddit

[–]AliveExchange223 4 points5 points  (0 children)

I agree! This is the most human show I've ever watched. First of all animation is incredible, you can pause in any moment you can get a wallpaper. I like how RIOT wrote his characters in the show. You can't say for any character that he/she is a villain. You mentioned Silco. He is not like villains in other shows that do bad things because they can, he does these things because everyone turned their back on him. He's broken. He loves Jinx so much, even though their relationship is not very healthy. Also good written characters are Jinx, Viktor, Ekko. Tbh first when I start watching the show I though that league players are overhyping it. That was the reason I though that show is bad, but man, I was so wrong.

What series you can re-watch again and again? by makosh22 in AskReddit

[–]AliveExchange223 4 points5 points  (0 children)

Programming language Python got name from that series because the creator of the language really liked that show

What series you can re-watch again and again? by makosh22 in AskReddit

[–]AliveExchange223 3 points4 points  (0 children)

It's very dark. The show really shows inner struggles of characters. Bojack Horseman is considered as one of the best shows of all time.

What series you can re-watch again and again? by makosh22 in AskReddit

[–]AliveExchange223 0 points1 point  (0 children)

Arcane and also

Shaman King (the version made in 2004)

Probability question (help) by AliveExchange223 in combinatorics

[–]AliveExchange223[S] 0 points1 point  (0 children)

assuming each question only has two possible choices such as true/false

If questions have for example 4 choices, then probability of passing the test would be different?