linxiaoziruo
V2EX  ›  Java

关于的疑惑

  •  
  •   linxiaoziruo · Jul 8, 2020 · 1694 views
    This topic created in 2152 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   ·   2762 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 06:02 · PVG 14:02 · LAX 23:02 · JFK 02:02
    ♥ Do have faith in what you're doing.