This is my solution:
int findLoop(struct Node* head)
{
if (head == nullptr)
{
return 0;
}
int countIndex = 0;
Type: Posts; User: HelpMeC
This is my solution:
int findLoop(struct Node* head)
{
if (head == nullptr)
{
return 0;
}
int countIndex = 0;
Hellp everyone.
Maybe someone can guide me how I can solve this exercise in an efficient way?
Thanks in advance.
http://www.up2me.co.il/thumbs/35229922.bmp
@laserlight -
Amazing.
I want to scrutinize your remarks more in depth, but now I have no time because I have some exercises in math courses to submit.
Thank you so much!
This is the header of my project (I know it's not ideal to contain all the classes at the same header but this is the requirement of our presubmission tool).
Maybe you can review the header and give...
@laserlight -
Thank you so much!!!!
@laserlight - Thanks for the correction.
BTW, if I want to consider lines starting with some white-space as invalid input. Can I change something elegantly at the final version of the parser, or...
@laserlight -
Declaration - right, it has its required memory allocated in compile-time.
Compiler warning - not sure how to do it right now so I won't waste your time and mine too as I must...
@laserlight -
Umm... yea, the difference between defining s here and defining smallerOne in my code -
Here we construct s with known-type in compile-time - everything is occurred in the current...
@laserlight -
Got it.
What did you mean by these extra words: "and that includes class instances"? Can you maybe give an example to emphasize what that means?
Thank you so much!!!
@laserlight -
- delete issue - Very important and good to know.
And here is a related question to the destruction issue -
This is a piece of a major method inside an implementation of a...
@laserlight -
This one: resToPrint.top() - gives us a pointer to a Fractal. But I don't want to delete the pointer itself (As the container is in charge of doing that) but what it points to - the...
@laserlight -
It's an ultra-important point.
What does it mean to only destroy a pointer itself? What is the process of destroying pointers? Just nullifying them?
So, I tried just a min ago to...
@laserlight -
Regarding the destruction - I'm pretty confused.
You agree that the container will destroy each pointer pushed into it - that is, if we push to it (new SierpinskyFractal(some_dim)) -...
@laserlight -
Actually the staff said we mustn't use regex.
As for Maxima - I meant, if you can show me how to change the pattern to also define maximums/minimums.
As for exceptions - Yea,...
@john.c - I have asked a member staff regarding the issue of empty lines - if there are empty lines between non-empty lines -> invalid input.
Besides that, they say, there can be an empty line at...
@laserlight -
Thanks for the amazing clarifications and "good to knows" details!
@john.c - Two questions:
1. Is there any special difference between doing that:
std::istringstream sin(line);
or that:
std::istringstream sin;
@john.c
Yea... That's how their idiotic solution works - but I'll verify it again.
You're amazing - thank you so much john!!!!!!!!!!!!!!!!!!!
It's like 4am now so I'll try to understand your...
@john.c
As for the extra chars - amazing!
As for the last problem - we can have multiple empty lines, but if there is any line which is non-empty after an empty line - that's an invalid input....
@john.c
Thank you for this solution!
Actually, now it seems that the first two problems are corrected, but still the third problem - the same issue.
And another problem seems to occur with...
Hello everyone.
Generally, the staff has recommended us to use Boost to parse the file, but I've installed it and not succeeded to implement anything with it.
So I have to parse a CSV file...
@laserlight -
Understood your points except for two little ones:
1. "but even in such a case the destructor must still be defined so that the destructors of derived classes can (implicitly) invoke...
Hey.
I have to implement some FractalDrawer project using inheritance and std::vector. I have described the details of the exercise here:
Fractal Drawer Project - STL and OOP - C++
Each...
@jogn.c - Thank you.
@john.c -
0. You're right, it's messy and it won't happen again.
1. Ah, so we can't assign b's y (hidden) to b_as_a's y.
2. Got it. But how can an object maintain two members with the same...