Code Monkey home page Code Monkey logo

fe-interview-1's Introduction

前端面试

GitHub issues GitHub forks GitHub stars

☕ 前端面试每日一题

每天 get 一个知识点

Day283:设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。

push(x);//将元素 x 推入栈中。
pop(); // 删除栈顶元素
top(); // 获取栈顶元素
getMin();// 检索栈中最小的元素

// 示例
MinStack minStack = new MinStack();
minStack.push(-2);
minStack.push(0);
minStack.push(-3);
minStack.getMin();   // --> 返回 -3
minStack.pop();
minStack.top();      // --> 返回 0
minStack.getMin();   // --> 返回 -2

答案&解析


📚 前端面试题汇总


📱 手机刷题(附带详细答案)

二维码加载失败请点击 入口

⏱️ 最近更新

🏠 前端面试 Family

如果你在工作中遇到问题、在面试中遇到疑惑、在前端路上遇到了阻碍,都可以加入我们前端星球 Family,我们会竭尽全力为大家答疑解惑,让我们共同努力,一同成长。


版权许可

本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可,只要保持原作者署名和非商用,您可以自由地阅读、分享、修改。

fe-interview-1's People

Contributors

genzhen avatar lgwebdream avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.