V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
linxiaoziruo
V2EX  ›  Java

关于的疑惑

  •  
  •   linxiaoziruo · Jul 8, 2020 · 1644 views
    This topic created in 2133 days ago, the information mentioned may be changed or developed.

    Java 为什么用堆来组织内存数据,有什么好处吗,具体对好处对场景是什么?

    Supplement 1  ·  Jul 8, 2020
    关于堆堆疑惑
    2 replies    2020-07-09 10:21:43 +08:00
    yidinghe
        1
    yidinghe  
       Jul 8, 2020
    任何对象都会在内存中占用一块,这一小块内存是有结构的,你就当是一块砖。程序运行过程中会产生很多砖,而如果我有很多砖,我就会把它们堆起来。所以……这是自然而然的结果吧。
    linxiaoziruo
        2
    linxiaoziruo  
    OP
       Jul 9, 2020
    @yidinghe 为什么用数据结构中的堆来组织数据,为什么不用链表或者平衡树来组织结构。为什么偏偏选中堆这个数据结构。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6158 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 02:51 · PVG 10:51 · LAX 19:51 · JFK 22:51
    ♥ Do have faith in what you're doing.