Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function "peek" example is not in CPP #3377

Open
SteveeeeSuuuu opened this issue Mar 31, 2024 · 0 comments
Open

function "peek" example is not in CPP #3377

SteveeeeSuuuu opened this issue Mar 31, 2024 · 0 comments

Comments

@SteveeeeSuuuu
Copy link

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant