Message from @taekahn
Discord ID: 543641859214409728
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. 😀
why not
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.
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.
Sorry, I don't like books that are specifically with interviews in mind. @Unwound
Doesn't mean it has to be bad.
to each his own, no worries.
They just don't place the right focus I think.
IMHO it's better to have a book that doesn't worry about interviews, like Skiena, Knuth, and so forth and then buy a separate book that is just about coding interviews.
Separation of concerns.