Message from @Yajat
Discord ID: 543640822302638093
anyone here got the divison 2 beta
??
Right guys I am going to watch the only normie show I still watch
catch you laters
Later?
the simpsons?
l8r m8
guys what if you had one chance
I am watching "Goldrush" it is basically ice road truckers but with gold miners
one moment in time to get what you wanted
GR is a descent show.
Oh okay I guess
would you convert adp to ATP by adding a phosphate?
i'd tap that, sure
It’s more of a process than that
yes no duh sherlock
```c
void* rl(struct node *root)
{
struct Node *p, *n, *c = root;
while (c)
{
n = c->next;
c->next = p;
p = c;
c = n;
}
return p;
}
```
Is it true?
I'm just going to admit my ignorance. Last time someone posted something cryptic and I googled it, I was not happy that I did. 😀
mitochondria is the powerhouse of the cell
There. That should be the shortest code possible.
Boundary conditions covered, too, if you pass null, you get null back.
Won't work for loops.
O(n) no extra storage.
would it kill you to give real names to your variables?
You could make a minor change for loop detection.
I wasn't sure. That's why I had to change it. I was inclined to type proper names, but I also wanted it short for Discord.
just store visited nodes
even easier, have a runner go 2x as fast, still o(n)
Yes, that is a common approach to loop detection.
@Undead Mockingbird I picked up this book years ago. It's written by Brian Kernighan who wrote C with Dennis Richie. In it he takes all sorts of routines like linked lists, trees, sorts and writes them in C, C++, Java, Perl, and a few others to show the strengths and weakness and the libraries of each. It sort of changed the way I looked at programming. It helped me to think of things language independent.
Skiena, Steven S. The algorithm design manual: Text. Vol. 1. Springer Science & Business Media, 1998.
didn't he die recently?
Elements of Programming Interviews is as good as it gets in regards to core CS fundamentals and interviews
Yes, that's a good point.
Dennis? unfortunately. almost a decade ago i think
@CasualSailor You should always think of algorithms primarily in terms of the abstract entities, not in terms of the programming language.