When I see functions such as isFull() or isEmpty(), you are no longer talking about arrays, but a more sophisticated data types. And by the way, because these functions have no parameter, you have some troubles to implement them ;)
But more important: in C++, you should probably use std::array or std::vector instead of plain C arrays, in most cases.
Good point Pierre!
My focus is more to explain the logic rather than going into the syntax of the language.
And yes, you are right about the isFull() and isEmpty() has no parameters but again I focused more on explaining rather than validating my code.
If code is not you main concern because you want to focus on algorithms, then you may use pseudo-code instead ;) Using a incomplete or incorrect may confuse your readers and distract them from your real purpose.
When I see functions such as
isFull()
orisEmpty()
, you are no longer talking about arrays, but a more sophisticated data types. And by the way, because these functions have no parameter, you have some troubles to implement them ;)But more important: in C++, you should probably use
std::array
orstd::vector
instead of plain C arrays, in most cases.Good point Pierre!
My focus is more to explain the logic rather than going into the syntax of the language.
And yes, you are right about the isFull() and isEmpty() has no parameters but again I focused more on explaining rather than validating my code.
Thank you for your suggestions buddy!
If code is not you main concern because you want to focus on algorithms, then you may use pseudo-code instead ;) Using a incomplete or incorrect may confuse your readers and distract them from your real purpose.
Hey Pierre,
I would love if you share some resources for us to learn more about Data Structures.
It would be a great help.
I don't have such documents available sorry ;)