Git Product home page Git Product logo

openscipt / fe-interview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lgwebdream/fe-interview

0.0 0.0 0.0 3.3 MB

🔥🔥🔥 前端面试,独有前端面试题详解,前端面试刷题必备,1000+前端面试真题,Html、Css、JavaScript、Vue、React、Node、TypeScript、Webpack、算法、网络与安全、浏览器

Home Page: https://lgwebdream.github.io/FE-Interview/

License: Other

JavaScript 100.00%

fe-interview's Introduction

前端面试

GitHub issues GitHub forks GitHub stars

☕ 前端面试每日一题

每天 get 一个知识点

Day284:如何用栈实现一个队列

push(x) // 将一个元素放入队列的尾部。
pop()  // 队列首部移除元素。
peek()  // 返回队列首部的元素。
empty() // 返回队列是否为空。

// 示例
MyQueue queue = new MyQueue();
queue.push(1);
queue.push(2);
queue.peek(); // 返回 1
queue.pop(); // 返回 1
queue.empty(); // 返回 false

// 说明
// 只能使用标准的栈操作 -- 也就是只有 push to top, peek/pop from top, size, 和 is empty 操作是合法的。
// 假设所有操作都是有效的 (例如,一个空的队列不会调用 pop 或者 peek 操作)。

答案&解析


📚 前端面试题汇总


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

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

⏱️ 最近更新

🏠 前端面试 Family

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


版权许可

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

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.