You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Algorithms and Data Structures for Beginners, stack part, function "peek" example for CPP seems not to be written in CPP.
What it looks like currently
fn peek():
// retrieve the last element
top = stack.get(lastIndex, lengthOfArray)
return top
To be ?
int peek() {
int res = stack_[stack_.size() - 1];
return res;
}
The text was updated successfully, but these errors were encountered:
In Algorithms and Data Structures for Beginners, stack part, function "peek" example for CPP seems not to be written in CPP.
What it looks like currently
fn peek():
// retrieve the last element
top = stack.get(lastIndex, lengthOfArray)
return top
To be ?
int peek() {
int res = stack_[stack_.size() - 1];
return res;
}
The text was updated successfully, but these errors were encountered: