Giter Site home page Giter Site logo

Comments (5)

LRH1993 avatar LRH1993 commented on August 22, 2024

这句话是在哪篇文章中的?

from android_interview.

Merpyzf avatar Merpyzf commented on August 22, 2024

java集合框架中的Queue的介绍里的

from android_interview.

LRH1993 avatar LRH1993 commented on August 22, 2024

队列先进先出,从队尾插入,队头取出。所以队头存在时间最长。可能与常规理解的有出入。改成从队头插入,队尾取出,队头时间最短,队尾时间最长,是不是更好理解一些?

from android_interview.

Merpyzf avatar Merpyzf commented on August 22, 2024

如果队列只插入元素而不取出元素的话,可以说队头元素在队列中保存的时间最长,因为是最先插入却又一直没被取出。
"队列的尾部是保存在队列中存放时间最短的元素"对于这句话我的理解是:既然队列是按照顺序依次从队头取出的,那么尾部存放的元素也是在队头元素取出后,依次向前移,但仍保存在队列中,怎么能称之为队尾时间最短呢?

from android_interview.

LRH1993 avatar LRH1993 commented on August 22, 2024

同一时间下,一个队列中,队头已经存在队列中的时间为最长,队尾已经存在队列中的时间也最短。

from android_interview.

Related Issues (20)

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.