[{"data":1,"prerenderedAt":2993},["ShallowReactive",2],{"\u002Fblog\u002FStack":3,"post-count":2579,"series-global-data":2580,"authors-all":2696,"series-sidebar-none":2891,"sidebar-authors":2892},{"id":4,"title":5,"author":6,"body":7,"date":2568,"description":51,"draft":2569,"edited_at":2568,"extension":2570,"featured_image":2571,"meta":2572,"navigation":2573,"path":2574,"pinned":2569,"seo":2575,"sitemap":2576,"stem":2577,"tags":2571,"__hash__":2578},"blog\u002Fblog\u002FStack.md","Stack","chinono",{"type":8,"value":9,"toc":2540},"minimark",[10,15,39,42,52,75,80,86,99,102,130,138,153,162,166,169,182,185,189,208,211,217,220,223,234,238,241,308,311,332,335,339,342,348,351,357,376,392,396,399,403,421,424,427,433,440,444,451,465,471,483,489,504,510,514,517,872,875,920,924,937,940,1037,1044,1048,1288,1291,1297,1308,1312,1315,1319,1322,1328,1343,1358,1364,1367,1387,1391,1462,1469,1473,1476,1482,1485,1492,1495,1501,1511,1515,1521,1526,1532,1538,1544,1549,1554,1560,1563,1567,1574,2378,2380,2386,2390,2393,2430,2436,2459,2463,2466,2536],[11,12,14],"h2",{"id":13},"a-quick-recap-where-stacks-fit-in","A Quick Recap: Where Stacks Fit In",[16,17,18,19,23,24,28,29,28,32,28,35,38],"p",{},"Before we get to stacks, let's place them on the map. In Java, almost every data structure lives inside something called the ",[20,21,22],"strong",{},"Collection Framework",". It's a family tree of interfaces and classes that all share the same basic vocabulary — things like ",[25,26,27],"code",{},"add",", ",[25,30,31],{},"remove",[25,33,34],{},"size",[25,36,37],{},"contains",", and so on.",[16,40,41],{},"Here's a simplified view of the hierarchy:",[43,44,49],"pre",{"className":45,"code":47,"language":48},[46],"language-text","                       Iterable\n                          |\n                      Collection\n            ______________|______________\n           |              |              |\n          List          Queue           Set\n        \u002F  |  \\           |            \u002F  |  \\\nArrayList LinkedList    Deque      HashSet ...\nVector                ArrayDeque\n  |\nStack\n","text",[25,50,47],{"__ignoreMap":51},"",[16,53,54,55,59,60,59,63,59,69,74],{},"The piece I want you to notice: ",[20,56,57],{},[25,58,5],{}," ",[20,61,62],{},"lives under",[20,64,65,68],{},[25,66,67],{},"Vector",", which lives under",[20,70,71],{},[25,72,73],{},"List",". That's a hint about what a stack actually is.",[76,77,79],"h3",{"id":78},"whats-a-list-again","What's a List, Again?",[16,81,82,83,85],{},"A ",[20,84,73],{}," is an Abstract Data Type (ADT) that stores items in a sequential order. Think of:",[87,88,89,93,96],"ul",{},[90,91,92],"li",{},"a list of students in a class",[90,94,95],{},"a list of available hotel rooms",[90,97,98],{},"a list of books on a shelf",[16,100,101],{},"The common operations you can do on a list:",[87,103,104,110,116,121,124,127],{},[90,105,106,109],{},[20,107,108],{},"Retrieve"," an element",[90,111,112,115],{},[20,113,114],{},"Insert"," a new element",[90,117,118,109],{},[20,119,120],{},"Delete",[90,122,123],{},"Check how many elements it has",[90,125,126],{},"Check whether some element is inside",[90,128,129],{},"Check if it's empty",[16,131,132,133,137],{},"There are two classic ways to ",[134,135,136],"em",{},"implement"," a list under the hood:",[139,140,141,147],"ol",{},[90,142,143,146],{},[20,144,145],{},"Using an array"," — fast random access by index, but inserting\u002Fremoving from the middle is slow (you have to shift everything).",[90,148,149,152],{},[20,150,151],{},"Using a linked list"," — fast insertion\u002Fdeletion anywhere, but slower to jump to a specific index.\nKeep this trade-off in your back pocket. It's going to come up again very soon.",[154,155,156],"blockquote",{},[16,157,158,161],{},[20,159,160],{},"Quick mental model:"," an array is like a row of numbered lockers — you can open locker #47 instantly, but rearranging them is a pain. A linked list is like a treasure hunt — each clue points to the next, so inserting a new clue is easy, but finding the 47th clue means following 46 others first.",[11,163,165],{"id":164},"introducing-the-stack","Introducing the Stack",[16,167,168],{},"Here's the one-sentence definition you should remember forever:",[154,170,171],{},[16,172,173,59,176,181],{},[20,174,175],{},"A stack is a list where elements are accessed, inserted, and deleted only from one end — called the",[134,177,178],{},[20,179,180],{},"top","**.**",[16,183,184],{},"That's it. Everything else about stacks follows from this constraint.",[76,186,188],{"id":187},"the-lifo-principle","The LIFO Principle",[16,190,191,192,195,196,199,200,203,204,207],{},"Because you can only add and remove from the top, the ",[134,193,194],{},"last"," item you put in is always the ",[134,197,198],{},"first"," item you take out. We call this ",[20,201,202],{},"LIFO",": ",[20,205,206],{},"Last-In, First-Out",".",[16,209,210],{},"Think of a stack of plates in a cafeteria:",[43,212,215],{"className":213,"code":214,"language":48},[46],"        🍽️   ← top (last one placed, first one taken)\n        🍽️\n        🍽️\n        🍽️   ← bottom\n",[25,216,214],{"__ignoreMap":51},[16,218,219],{},"You don't pull a plate from the middle of the stack — you take the one on top. If you want the bottom plate, tough luck, you have to remove all the ones above it first.",[16,221,222],{},"Other real-world examples:",[87,224,225,228,231],{},[90,226,227],{},"A pile of pancakes (the one on top gets eaten first)",[90,229,230],{},"The browser's back button history (last page you visited is the first one you go back to)",[90,232,233],{},"The \"undo\" function in your text editor (your last action is the first to be undone)",[76,235,237],{"id":236},"the-three-core-methods","The Three Core Methods",[16,239,240],{},"Every stack supports three fundamental operations:",[242,243,244,257],"table",{},[245,246,247],"thead",{},[248,249,250,254],"tr",{},[251,252,253],"th",{},"Method",[251,255,256],{},"What it does",[258,259,260,275,289],"tbody",{},[248,261,262,268],{},[263,264,265],"td",{},[25,266,267],{},"push(x)",[263,269,270,271,274],{},"Adds element ",[25,272,273],{},"x"," to the top",[248,276,277,282],{},[263,278,279],{},[25,280,281],{},"pop()",[263,283,284,285,288],{},"Removes ",[20,286,287],{},"and returns"," the top element",[248,290,291,301],{},[263,292,293,296,297,300],{},[25,294,295],{},"peek()"," (or ",[25,298,299],{},"top()",")",[263,302,303,304,307],{},"Returns the top element ",[134,305,306],{},"without"," removing it",[16,309,310],{},"Sometimes you'll also see:",[87,312,313,323],{},[90,314,315,318,319,322],{},[25,316,317],{},"isEmpty()"," — returns ",[25,320,321],{},"true"," if the stack has no elements",[90,324,325,296,328,331],{},[25,326,327],{},"size()",[25,329,330],{},"getSize()",") — returns how many elements are in the stack",[16,333,334],{},"That's the entire stack interface. Beautifully small.",[76,336,338],{"id":337},"a-worked-example","A Worked Example",[16,340,341],{},"Let's trace through what happens with the following operations:",[43,343,346],{"className":344,"code":345,"language":48},[46],"1. Push A\n2. Push B\n3. Push C\n4. Pop  (removes C)\n5. Pop  (removes B)\n6. Push D\n",[25,347,345],{"__ignoreMap":51},[16,349,350],{},"Here's what the stack looks like after each step:",[43,352,355],{"className":353,"code":354,"language":48},[46],"Step 1: Push A     Step 2: Push B     Step 3: Push C\n                                          | C |  ← top\n                      | B |  ← top        | B |\n   | A |  ← top       | A |               | A |\n   +---+              +---+               +---+\n \n \nStep 4: Pop (C)    Step 5: Pop (B)    Step 6: Push D\n                                          | D |  ← top\n   | B |  ← top                           | A |\n   | A |              | A |  ← top        +---+\n   +---+              +---+\n",[25,356,354],{"__ignoreMap":51},[16,358,359,360,363,364,367,368,371,372,375],{},"After step 6, the stack contains ",[25,361,362],{},"A"," at the bottom and ",[25,365,366],{},"D"," at the top. Notice that ",[25,369,370],{},"B"," and ",[25,373,374],{},"C"," are gone — they were popped off and are no longer in the structure.",[154,377,378],{},[16,379,380,383,384,391],{},[20,381,382],{},"Try it yourself:"," there's a great interactive visualization at ",[385,386,390],"a",{"href":387,"rel":388},"https:\u002F\u002Fyongdanielliang.github.io\u002Fanimation\u002Fweb\u002FStack.html",[389],"nofollow","Daniel Liang's Stack Animation",". Highly recommended for getting an intuitive feel.",[11,393,395],{"id":394},"implementing-a-stack-in-java","Implementing a Stack in Java",[16,397,398],{},"Now for the fun part — building one ourselves.",[76,400,402],{"id":401},"why-an-arraylist-works-so-well","Why an ArrayList Works So Well",[16,404,405,406,409,410,413,414,371,417,420],{},"Recall the trade-off between arrays and linked lists. With a stack, we ",[20,407,408],{},"only ever add and remove from one end",". That's exactly the operation that arrays are ",[134,411,412],{},"fast"," at. We don't need fancy middle-insertion — we just need a fast ",[25,415,416],{},"add to end",[25,418,419],{},"remove from end",", both of which are O(1) on an ArrayList.",[16,422,423],{},"So for a stack, an ArrayList is the more efficient backing structure.",[16,425,426],{},"Conceptually:",[43,428,431],{"className":429,"code":430,"language":48},[46],"                  Top\n                   ↓\n      |  C  |\n      |  B  |        Same data as ArrayList:\n      |  A  |   →    [ A, B, C ]\n      +-----+               ↑\n       Bottom              \"back\"\n",[25,432,430],{"__ignoreMap":51},[16,434,435,436,439],{},"The top of the stack corresponds to the ",[134,437,438],{},"end"," of the array list. The bottom is index 0.",[76,441,443],{"id":442},"two-design-choices-inheritance-vs-composition","Two Design Choices: Inheritance vs Composition",[16,445,446,447,450],{},"When designing the ",[25,448,449],{},"GenericStack"," class, we have two ways to use ArrayList under the hood:",[16,452,453,456,457,59,459,59,462,207],{},[20,454,455],{},"Option 1: Inheritance"," — make ",[25,458,449],{},[134,460,461],{},"extend",[25,463,464],{},"ArrayList",[43,466,469],{"className":467,"code":468,"language":48},[46],"ArrayList ←─── GenericStack   (GenericStack IS-A ArrayList)\n",[25,470,468],{"__ignoreMap":51},[16,472,473,476,477,479,480,207],{},[20,474,475],{},"Option 2: Composition"," — give ",[25,478,449],{}," an ArrayList as a ",[134,481,482],{},"private field",[43,484,487],{"className":485,"code":486,"language":48},[46],"GenericStack ◇─── ArrayList   (GenericStack HAS-A ArrayList)\n",[25,488,486],{"__ignoreMap":51},[16,490,491,492,495,496,499,500,503],{},"Both work, but ",[20,493,494],{},"composition is generally preferred"," for stacks. Why? Because if we use inheritance, our stack would inherit ",[134,497,498],{},"all"," of ArrayList's methods — including things like ",[25,501,502],{},"add(int index, Object o)"," that let you insert in the middle. That breaks the whole point of a stack: you'd no longer have a guarantee that things only enter\u002Fleave from the top.",[16,505,506,507],{},"Composition lets us hide the ArrayList completely and only expose the stack operations we want. ",[20,508,509],{},"Composition gives us encapsulation; inheritance leaks the abstraction.",[76,511,513],{"id":512},"the-genericstack-class","The GenericStack Class",[16,515,516],{},"Here's the full implementation using composition:",[43,518,522],{"className":519,"code":520,"language":521,"meta":51,"style":51},"language-java shiki shiki-themes github-light github-dark","public class GenericStack\u003CE> {\n    private java.util.ArrayList\u003CE> list = new java.util.ArrayList\u003C>();\n \n    public int getSize() {\n        return list.size();\n    }\n \n    public E peek() {\n        return list.get(getSize() - 1);\n    }\n \n    public void push(E o) {\n        list.add(o);\n    }\n \n    public E pop() {\n        E o = list.get(getSize() - 1);\n        list.remove(getSize() - 1);\n        return o;\n    }\n \n    public boolean isEmpty() {\n        return list.isEmpty();\n    }\n \n    @Override\n    public String toString() {\n        return \"stack: \" + list.toString();\n    }\n}\n","java",[25,523,524,550,573,579,594,608,614,619,632,661,666,671,692,703,708,713,725,749,768,776,781,786,799,811,816,821,830,843,861,866],{"__ignoreMap":51},[525,526,529,533,536,540,544,547],"span",{"class":527,"line":528},"line",1,[525,530,532],{"class":531},"szBVR","public",[525,534,535],{"class":531}," class",[525,537,539],{"class":538},"sScJk"," GenericStack",[525,541,543],{"class":542},"sVt8B","\u003C",[525,545,546],{"class":531},"E",[525,548,549],{"class":542},"> {\n",[525,551,553,556,559,561,564,567,570],{"class":527,"line":552},2,[525,554,555],{"class":531},"    private",[525,557,558],{"class":542}," java.util.ArrayList\u003C",[525,560,546],{"class":531},[525,562,563],{"class":542},"> list ",[525,565,566],{"class":531},"=",[525,568,569],{"class":531}," new",[525,571,572],{"class":542}," java.util.ArrayList\u003C>();\n",[525,574,576],{"class":527,"line":575},3,[525,577,578],{"class":542}," \n",[525,580,582,585,588,591],{"class":527,"line":581},4,[525,583,584],{"class":531},"    public",[525,586,587],{"class":531}," int",[525,589,590],{"class":538}," getSize",[525,592,593],{"class":542},"() {\n",[525,595,597,600,603,605],{"class":527,"line":596},5,[525,598,599],{"class":531},"        return",[525,601,602],{"class":542}," list.",[525,604,34],{"class":538},[525,606,607],{"class":542},"();\n",[525,609,611],{"class":527,"line":610},6,[525,612,613],{"class":542},"    }\n",[525,615,617],{"class":527,"line":616},7,[525,618,578],{"class":542},[525,620,622,624,627,630],{"class":527,"line":621},8,[525,623,584],{"class":531},[525,625,626],{"class":542}," E ",[525,628,629],{"class":538},"peek",[525,631,593],{"class":542},[525,633,635,637,639,642,645,648,651,654,658],{"class":527,"line":634},9,[525,636,599],{"class":531},[525,638,602],{"class":542},[525,640,641],{"class":538},"get",[525,643,644],{"class":542},"(",[525,646,647],{"class":538},"getSize",[525,649,650],{"class":542},"() ",[525,652,653],{"class":531},"-",[525,655,657],{"class":656},"sj4cs"," 1",[525,659,660],{"class":542},");\n",[525,662,664],{"class":527,"line":663},10,[525,665,613],{"class":542},[525,667,669],{"class":527,"line":668},11,[525,670,578],{"class":542},[525,672,674,676,679,682,685,689],{"class":527,"line":673},12,[525,675,584],{"class":531},[525,677,678],{"class":531}," void",[525,680,681],{"class":538}," push",[525,683,684],{"class":542},"(E ",[525,686,688],{"class":687},"s4XuR","o",[525,690,691],{"class":542},") {\n",[525,693,695,698,700],{"class":527,"line":694},13,[525,696,697],{"class":542},"        list.",[525,699,27],{"class":538},[525,701,702],{"class":542},"(o);\n",[525,704,706],{"class":527,"line":705},14,[525,707,613],{"class":542},[525,709,711],{"class":527,"line":710},15,[525,712,578],{"class":542},[525,714,716,718,720,723],{"class":527,"line":715},16,[525,717,584],{"class":531},[525,719,626],{"class":542},[525,721,722],{"class":538},"pop",[525,724,593],{"class":542},[525,726,728,731,733,735,737,739,741,743,745,747],{"class":527,"line":727},17,[525,729,730],{"class":542},"        E o ",[525,732,566],{"class":531},[525,734,602],{"class":542},[525,736,641],{"class":538},[525,738,644],{"class":542},[525,740,647],{"class":538},[525,742,650],{"class":542},[525,744,653],{"class":531},[525,746,657],{"class":656},[525,748,660],{"class":542},[525,750,752,754,756,758,760,762,764,766],{"class":527,"line":751},18,[525,753,697],{"class":542},[525,755,31],{"class":538},[525,757,644],{"class":542},[525,759,647],{"class":538},[525,761,650],{"class":542},[525,763,653],{"class":531},[525,765,657],{"class":656},[525,767,660],{"class":542},[525,769,771,773],{"class":527,"line":770},19,[525,772,599],{"class":531},[525,774,775],{"class":542}," o;\n",[525,777,779],{"class":527,"line":778},20,[525,780,613],{"class":542},[525,782,784],{"class":527,"line":783},21,[525,785,578],{"class":542},[525,787,789,791,794,797],{"class":527,"line":788},22,[525,790,584],{"class":531},[525,792,793],{"class":531}," boolean",[525,795,796],{"class":538}," isEmpty",[525,798,593],{"class":542},[525,800,802,804,806,809],{"class":527,"line":801},23,[525,803,599],{"class":531},[525,805,602],{"class":542},[525,807,808],{"class":538},"isEmpty",[525,810,607],{"class":542},[525,812,814],{"class":527,"line":813},24,[525,815,613],{"class":542},[525,817,819],{"class":527,"line":818},25,[525,820,578],{"class":542},[525,822,824,827],{"class":527,"line":823},26,[525,825,826],{"class":542},"    @",[525,828,829],{"class":531},"Override\n",[525,831,833,835,838,841],{"class":527,"line":832},27,[525,834,584],{"class":531},[525,836,837],{"class":542}," String ",[525,839,840],{"class":538},"toString",[525,842,593],{"class":542},[525,844,846,848,852,855,857,859],{"class":527,"line":845},28,[525,847,599],{"class":531},[525,849,851],{"class":850},"sZZnC"," \"stack: \"",[525,853,854],{"class":531}," +",[525,856,602],{"class":542},[525,858,840],{"class":538},[525,860,607],{"class":542},[525,862,864],{"class":527,"line":863},29,[525,865,613],{"class":542},[525,867,869],{"class":527,"line":868},30,[525,870,871],{"class":542},"}\n",[16,873,874],{},"Let's read through it:",[87,876,877,896,906,915],{},[90,878,879,880,883,884,887,888,891,892,895],{},"The ",[25,881,882],{},"\u003CE>"," makes it ",[20,885,886],{},"generic"," — you can have a ",[25,889,890],{},"GenericStack\u003CString>",", a ",[25,893,894],{},"GenericStack\u003CInteger>",", whatever you need.",[90,897,898,901,902,905],{},[25,899,900],{},"push(o)"," is literally just ",[25,903,904],{},"list.add(o)"," — adding to the end.",[90,907,908,910,911,914],{},[25,909,295],{}," is ",[25,912,913],{},"list.get(size - 1)"," — looking at the last element.",[90,916,917,919],{},[25,918,281],{}," reads the last element, removes it from the list, and returns it.",[76,921,923],{"id":922},"handling-the-empty-case","Handling the Empty Case",[16,925,926,927,929,930,932,933,936],{},"There's a subtle problem: what if someone calls ",[25,928,281],{}," or ",[25,931,295],{}," on an empty stack? You'd get an ",[25,934,935],{},"IndexOutOfBoundsException"," — not very informative.",[16,938,939],{},"A cleaner approach is to check first and throw a meaningful exception:",[43,941,943],{"className":519,"code":942,"language":521,"meta":51,"style":51},"public E pop() {\n    if (isEmpty()) {\n        throw new EmptyStackException();\n    }\n    E o = list.get(getSize() - 1);\n    list.remove(getSize() - 1);\n    return o;\n}\n",[25,944,945,955,968,980,984,1007,1026,1033],{"__ignoreMap":51},[525,946,947,949,951,953],{"class":527,"line":528},[525,948,532],{"class":531},[525,950,626],{"class":542},[525,952,722],{"class":538},[525,954,593],{"class":542},[525,956,957,960,963,965],{"class":527,"line":552},[525,958,959],{"class":531},"    if",[525,961,962],{"class":542}," (",[525,964,808],{"class":538},[525,966,967],{"class":542},"()) {\n",[525,969,970,973,975,978],{"class":527,"line":575},[525,971,972],{"class":531},"        throw",[525,974,569],{"class":531},[525,976,977],{"class":538}," EmptyStackException",[525,979,607],{"class":542},[525,981,982],{"class":527,"line":581},[525,983,613],{"class":542},[525,985,986,989,991,993,995,997,999,1001,1003,1005],{"class":527,"line":596},[525,987,988],{"class":542},"    E o ",[525,990,566],{"class":531},[525,992,602],{"class":542},[525,994,641],{"class":538},[525,996,644],{"class":542},[525,998,647],{"class":538},[525,1000,650],{"class":542},[525,1002,653],{"class":531},[525,1004,657],{"class":656},[525,1006,660],{"class":542},[525,1008,1009,1012,1014,1016,1018,1020,1022,1024],{"class":527,"line":610},[525,1010,1011],{"class":542},"    list.",[525,1013,31],{"class":538},[525,1015,644],{"class":542},[525,1017,647],{"class":538},[525,1019,650],{"class":542},[525,1021,653],{"class":531},[525,1023,657],{"class":656},[525,1025,660],{"class":542},[525,1027,1028,1031],{"class":527,"line":616},[525,1029,1030],{"class":531},"    return",[525,1032,775],{"class":542},[525,1034,1035],{"class":527,"line":621},[525,1036,871],{"class":542},[16,1038,1039,1040,1043],{},"This is what Java's own built-in ",[25,1041,1042],{},"java.util.Stack"," does. When you write production code, you'd want this kind of defensive check.",[76,1045,1047],{"id":1046},"testing-it-out","Testing It Out",[43,1049,1051],{"className":519,"code":1050,"language":521,"meta":51,"style":51},"public class TestGenericStack {\n    public static void main(String[] args) {\n        GenericStack\u003CString> stack = new GenericStack\u003C>();\n \n        stack.push(\"Tom\");\n        System.out.println(\"(1) \" + stack);\n \n        stack.push(\"Susan\");\n        System.out.println(\"(2) \" + stack);\n \n        stack.push(\"Kim\");\n        stack.push(\"Michael\");\n        System.out.println(\"(3) \" + stack);\n \n        System.out.println(\"(4) \" + stack.pop());\n        System.out.println(\"(5) \" + stack.pop());\n        System.out.println(\"(6) \" + stack);\n    }\n}\n",[25,1052,1053,1065,1090,1107,1111,1126,1144,1148,1161,1176,1180,1193,1206,1221,1225,1246,1265,1280,1284],{"__ignoreMap":51},[525,1054,1055,1057,1059,1062],{"class":527,"line":528},[525,1056,532],{"class":531},[525,1058,535],{"class":531},[525,1060,1061],{"class":538}," TestGenericStack",[525,1063,1064],{"class":542}," {\n",[525,1066,1067,1069,1072,1074,1077,1079,1082,1085,1088],{"class":527,"line":552},[525,1068,584],{"class":531},[525,1070,1071],{"class":531}," static",[525,1073,678],{"class":531},[525,1075,1076],{"class":538}," main",[525,1078,644],{"class":542},[525,1080,1081],{"class":531},"String",[525,1083,1084],{"class":542},"[] ",[525,1086,1087],{"class":687},"args",[525,1089,691],{"class":542},[525,1091,1092,1095,1097,1100,1102,1104],{"class":527,"line":575},[525,1093,1094],{"class":542},"        GenericStack\u003C",[525,1096,1081],{"class":531},[525,1098,1099],{"class":542},"> stack ",[525,1101,566],{"class":531},[525,1103,569],{"class":531},[525,1105,1106],{"class":542}," GenericStack\u003C>();\n",[525,1108,1109],{"class":527,"line":581},[525,1110,578],{"class":542},[525,1112,1113,1116,1119,1121,1124],{"class":527,"line":596},[525,1114,1115],{"class":542},"        stack.",[525,1117,1118],{"class":538},"push",[525,1120,644],{"class":542},[525,1122,1123],{"class":850},"\"Tom\"",[525,1125,660],{"class":542},[525,1127,1128,1131,1134,1136,1139,1141],{"class":527,"line":610},[525,1129,1130],{"class":542},"        System.out.",[525,1132,1133],{"class":538},"println",[525,1135,644],{"class":542},[525,1137,1138],{"class":850},"\"(1) \"",[525,1140,854],{"class":531},[525,1142,1143],{"class":542}," stack);\n",[525,1145,1146],{"class":527,"line":616},[525,1147,578],{"class":542},[525,1149,1150,1152,1154,1156,1159],{"class":527,"line":621},[525,1151,1115],{"class":542},[525,1153,1118],{"class":538},[525,1155,644],{"class":542},[525,1157,1158],{"class":850},"\"Susan\"",[525,1160,660],{"class":542},[525,1162,1163,1165,1167,1169,1172,1174],{"class":527,"line":634},[525,1164,1130],{"class":542},[525,1166,1133],{"class":538},[525,1168,644],{"class":542},[525,1170,1171],{"class":850},"\"(2) \"",[525,1173,854],{"class":531},[525,1175,1143],{"class":542},[525,1177,1178],{"class":527,"line":663},[525,1179,578],{"class":542},[525,1181,1182,1184,1186,1188,1191],{"class":527,"line":668},[525,1183,1115],{"class":542},[525,1185,1118],{"class":538},[525,1187,644],{"class":542},[525,1189,1190],{"class":850},"\"Kim\"",[525,1192,660],{"class":542},[525,1194,1195,1197,1199,1201,1204],{"class":527,"line":673},[525,1196,1115],{"class":542},[525,1198,1118],{"class":538},[525,1200,644],{"class":542},[525,1202,1203],{"class":850},"\"Michael\"",[525,1205,660],{"class":542},[525,1207,1208,1210,1212,1214,1217,1219],{"class":527,"line":694},[525,1209,1130],{"class":542},[525,1211,1133],{"class":538},[525,1213,644],{"class":542},[525,1215,1216],{"class":850},"\"(3) \"",[525,1218,854],{"class":531},[525,1220,1143],{"class":542},[525,1222,1223],{"class":527,"line":705},[525,1224,578],{"class":542},[525,1226,1227,1229,1231,1233,1236,1238,1241,1243],{"class":527,"line":710},[525,1228,1130],{"class":542},[525,1230,1133],{"class":538},[525,1232,644],{"class":542},[525,1234,1235],{"class":850},"\"(4) \"",[525,1237,854],{"class":531},[525,1239,1240],{"class":542}," stack.",[525,1242,722],{"class":538},[525,1244,1245],{"class":542},"());\n",[525,1247,1248,1250,1252,1254,1257,1259,1261,1263],{"class":527,"line":715},[525,1249,1130],{"class":542},[525,1251,1133],{"class":538},[525,1253,644],{"class":542},[525,1255,1256],{"class":850},"\"(5) \"",[525,1258,854],{"class":531},[525,1260,1240],{"class":542},[525,1262,722],{"class":538},[525,1264,1245],{"class":542},[525,1266,1267,1269,1271,1273,1276,1278],{"class":527,"line":727},[525,1268,1130],{"class":542},[525,1270,1133],{"class":538},[525,1272,644],{"class":542},[525,1274,1275],{"class":850},"\"(6) \"",[525,1277,854],{"class":531},[525,1279,1143],{"class":542},[525,1281,1282],{"class":527,"line":751},[525,1283,613],{"class":542},[525,1285,1286],{"class":527,"line":770},[525,1287,871],{"class":542},[16,1289,1290],{},"Output:",[43,1292,1295],{"className":1293,"code":1294,"language":48},[46],"(1) stack: [Tom]\n(2) stack: [Tom, Susan]\n(3) stack: [Tom, Susan, Kim, Michael]\n(4) Michael\n(5) Kim\n(6) stack: [Tom, Susan]\n",[25,1296,1294],{"__ignoreMap":51},[16,1298,1299,1300,1303,1304,1307],{},"Notice how ",[25,1301,1302],{},"Michael"," came out first (he was pushed last), then ",[25,1305,1306],{},"Kim",". That's LIFO in action.",[11,1309,1311],{"id":1310},"postfix-evaluation-a-real-use-case-for-stacks","Postfix Evaluation: A Real Use Case for Stacks",[16,1313,1314],{},"This is where stacks earn their keep. Let me show you a beautiful application.",[76,1316,1318],{"id":1317},"what-is-postfix-notation","What Is Postfix Notation?",[16,1320,1321],{},"You've been writing math your whole life like this:",[43,1323,1326],{"className":1324,"code":1325,"language":48},[46],"3 + 4\n",[25,1327,1325],{"__ignoreMap":51},[16,1329,1330,1331,1334,1335,1338,1339,1342],{},"That's called ",[20,1332,1333],{},"infix"," notation — the operator (",[25,1336,1337],{},"+",") is ",[134,1340,1341],{},"in between"," the operands. It's how humans read math.",[16,1344,1345,1346,1349,1350,1353,1354,1357],{},"But there's another way to write expressions: ",[20,1347,1348],{},"postfix"," notation, also called ",[20,1351,1352],{},"Reverse Polish Notation (RPN)",", where the operator comes ",[134,1355,1356],{},"after"," its operands:",[43,1359,1362],{"className":1360,"code":1361,"language":48},[46],"3 4 +\n",[25,1363,1361],{"__ignoreMap":51},[16,1365,1366],{},"It looks weird at first, but RPN has three wonderful properties:",[139,1368,1369,1375,1381],{},[90,1370,1371,1374],{},[20,1372,1373],{},"No precedence rules needed."," You don't have to memorize PEMDAS \u002F BODMAS.",[90,1376,1377,1380],{},[20,1378,1379],{},"No parentheses needed."," Ever.",[90,1382,1383,1386],{},[20,1384,1385],{},"Faster for computers to evaluate"," — fewer memory accesses.",[76,1388,1390],{"id":1389},"infix-postfix-examples","Infix → Postfix Examples",[242,1392,1393,1406],{},[245,1394,1395],{},[248,1396,1397,1400,1403],{},[251,1398,1399],{},"Infix",[251,1401,1402],{},"Postfix (RPN)",[251,1404,1405],{},"Why",[258,1407,1408,1429,1447],{},[248,1409,1410,1415,1420],{},[263,1411,1412],{},[25,1413,1414],{},"a + b * c",[263,1416,1417],{},[25,1418,1419],{},"a b c * +",[263,1421,1422,1425,1426,1428],{},[25,1423,1424],{},"*"," binds tighter than ",[25,1427,1337],{},", so it's computed first",[248,1430,1431,1436,1441],{},[263,1432,1433],{},[25,1434,1435],{},"(a + b) * c",[263,1437,1438],{},[25,1439,1440],{},"a b + c *",[263,1442,1443,1444,1446],{},"Parentheses force ",[25,1445,1337],{}," first",[248,1448,1449,1454,1459],{},[263,1450,1451],{},[25,1452,1453],{},"(a*b + c) \u002F d + e",[263,1455,1456],{},[25,1457,1458],{},"a b * c + d \u002F e +",[263,1460,1461],{},"Inner subexpression first, then division, then final addition",[16,1463,1464,1465,1468],{},"Read each postfix expression left to right and you'll notice: ",[20,1466,1467],{},"every operator immediately follows its two operands",". That's the rule.",[76,1470,1472],{"id":1471},"the-stack-based-algorithm","The Stack-Based Algorithm",[16,1474,1475],{},"Here's the magical part. Evaluating a postfix expression is shockingly simple with a stack:",[43,1477,1480],{"className":1478,"code":1479,"language":48},[46],"1. Scan the expression left to right, token by token.\n2. If the token is an OPERAND (a number):\n       → push it onto the stack.\n3. If the token is an OPERATOR (+, -, *, \u002F, ^):\n       → pop two operands off the stack\n         (the first pop is the right operand,\n          the second pop is the left operand)\n       → compute: left OPERATOR right\n       → push the result back onto the stack.\n4. When done, the single value left on the stack is the answer.\n",[25,1481,1479],{"__ignoreMap":51},[16,1483,1484],{},"That's the whole algorithm.",[76,1486,1488,1489],{"id":1487},"worked-example-evaluating-4-3-5","Worked Example: Evaluating ",[25,1490,1491],{},"4 3 5 * +",[16,1493,1494],{},"Let me trace it step by step:",[43,1496,1499],{"className":1497,"code":1498,"language":48},[46],"Token: 4         Token: 3         Token: 5\nPush 4           Push 3           Push 5\n \n  |   |            | 3 |            | 5 |\n  | 4 |            | 4 |            | 3 |\n  +---+            +---+            | 4 |\n                                    +---+\n \n \nToken: *                          Token: +\nPop 5 (right), Pop 3 (left)       Pop 15 (right), Pop 4 (left)\nCompute 3 * 5 = 15                Compute 4 + 15 = 19\nPush 15                           Push 19\n \n  | 15 |                            | 19 |\n  |  4 |                            +----+\n  +----+\n \nFinal answer: 19\n",[25,1500,1498],{"__ignoreMap":51},[16,1502,1503,1504,1506,1507,1510],{},"Sanity check: in infix, ",[25,1505,1491],{}," corresponds to ",[25,1508,1509],{},"4 + (3 * 5) = 4 + 15 = 19",". ✓",[76,1512,1514],{"id":1513},"when-things-go-wrong-error-detection","When Things Go Wrong: Error Detection",[16,1516,1517,1518],{},"A beautiful side-effect of this algorithm: ",[20,1519,1520],{},"the state of the stack tells you about errors.",[16,1522,1523],{},[20,1524,1525],{},"Error case 1: Too many operators",[16,1527,1528,1529],{},"Expression: ",[25,1530,1531],{},"3 8 + * 9",[43,1533,1536],{"className":1534,"code":1535,"language":48},[46],"Push 3, push 8   →   stack: [3, 8]\nSee \"+\", pop both, compute 3+8 = 11, push   →   stack: [11]\nSee \"*\"  →   need to pop two operands, but stack has only ONE element!\n",[25,1537,1535],{"__ignoreMap":51},[16,1539,1540,1541,1543],{},"The moment we try to apply ",[25,1542,1424],{}," with only one thing on the stack, we know the input is malformed.",[16,1545,1546],{},[20,1547,1548],{},"Error case 2: Too many operands",[16,1550,1528,1551],{},[25,1552,1553],{},"9 8 + 7",[43,1555,1558],{"className":1556,"code":1557,"language":48},[46],"Push 9, push 8   →   stack: [9, 8]\nSee \"+\", pop, compute 17, push   →   stack: [17]\nPush 7   →   stack: [17, 7]\nEnd of input — but the stack has TWO elements!\n",[25,1559,1557],{"__ignoreMap":51},[16,1561,1562],{},"A valid postfix expression always ends with exactly one number on the stack. If there's more, something was left dangling.",[76,1564,1566],{"id":1565},"java-implementation","Java Implementation",[16,1568,1569,1570,1573],{},"Here's a working ",[25,1571,1572],{},"PostfixEvaluation"," class. I've kept it close to the lecture version but added comments:",[43,1575,1577],{"className":519,"code":1576,"language":521,"meta":51,"style":51},"public class PostfixEvaluation {\n    public static void main(String[] args) {\n        System.out.println(\"Testing PostfixEvaluation:\\n\");\n        System.out.println(\"2 3 + 4 * 5 - : \"\n                + evaluatePostfix(\"2 3 + 4 * 5 -\") + \"\\n\");\n        System.out.println(\"2 3 * 4 2 - \u002F 5 6 * + : \"\n                + evaluatePostfix(\"2 3 * 4 2 - \u002F 5 6 * +\") + \"\\n\");\n        System.out.println(\"2 4 - 3 ^ 5 + : \"\n                + evaluatePostfix(\"2 4 - 3 ^ 5 +\") + \"\\n\");\n        System.out.println(\"Done.\");\n    }\n \n    \u002F** Evaluates a postfix expression and returns the result. *\u002F\n    public static double evaluatePostfix(String postfix) {\n        GenericStack\u003CDouble> valueStack = new GenericStack\u003C>();\n        String[] tokens = postfix.split(\" \");\n \n        for (String token : tokens) {\n            if (isNumeric(token)) {\n                valueStack.push(new Double(token));\n            } else if (token.equals(\"+\") || token.equals(\"-\")\n                    || token.equals(\"*\") || token.equals(\"\u002F\")\n                    || token.equals(\"^\")) {\n                Double operandTwo = valueStack.pop();   \u002F\u002F right operand\n                Double operandOne = valueStack.pop();   \u002F\u002F left operand\n                Double result = compute(operandOne, operandTwo, token);\n                valueStack.push(result);\n            }\n        }\n \n        return valueStack.peek();\n    }\n \n    public static boolean isNumeric(String str) {\n        try {\n            double d = Double.parseDouble(str);\n        } catch (NumberFormatException nfe) {\n            return false;\n        }\n        return true;\n    }\n \n    private static Double compute(Double operandOne, Double operandTwo,\n                                  String operator) {\n        double result;\n        switch (operator) {\n            case \"+\": result = operandOne + operandTwo; break;\n            case \"-\": result = operandOne - operandTwo; break;\n            case \"*\": result = operandOne * operandTwo; break;\n            case \"\u002F\": result = operandOne \u002F operandTwo; break;\n            case \"^\": result = Math.pow(operandOne, operandTwo); break;\n            default:  result = 0; break;  \u002F\u002F unexpected character\n        }\n        return result;\n    }\n}\n",[25,1578,1579,1590,1610,1629,1640,1667,1678,1701,1712,1735,1748,1752,1756,1762,1780,1796,1819,1823,1837,1850,1868,1908,1937,1953,1971,1987,2000,2009,2014,2019,2023,2034,2039,2044,2063,2071,2091,2108,2120,2125,2135,2140,2145,2173,2184,2193,2202,2231,2255,2279,2304,2331,2356,2361,2368,2373],{"__ignoreMap":51},[525,1580,1581,1583,1585,1588],{"class":527,"line":528},[525,1582,532],{"class":531},[525,1584,535],{"class":531},[525,1586,1587],{"class":538}," PostfixEvaluation",[525,1589,1064],{"class":542},[525,1591,1592,1594,1596,1598,1600,1602,1604,1606,1608],{"class":527,"line":552},[525,1593,584],{"class":531},[525,1595,1071],{"class":531},[525,1597,678],{"class":531},[525,1599,1076],{"class":538},[525,1601,644],{"class":542},[525,1603,1081],{"class":531},[525,1605,1084],{"class":542},[525,1607,1087],{"class":687},[525,1609,691],{"class":542},[525,1611,1612,1614,1616,1618,1621,1624,1627],{"class":527,"line":575},[525,1613,1130],{"class":542},[525,1615,1133],{"class":538},[525,1617,644],{"class":542},[525,1619,1620],{"class":850},"\"Testing PostfixEvaluation:",[525,1622,1623],{"class":656},"\\n",[525,1625,1626],{"class":850},"\"",[525,1628,660],{"class":542},[525,1630,1631,1633,1635,1637],{"class":527,"line":581},[525,1632,1130],{"class":542},[525,1634,1133],{"class":538},[525,1636,644],{"class":542},[525,1638,1639],{"class":850},"\"2 3 + 4 * 5 - : \"\n",[525,1641,1642,1645,1648,1650,1653,1656,1658,1661,1663,1665],{"class":527,"line":596},[525,1643,1644],{"class":531},"                +",[525,1646,1647],{"class":538}," evaluatePostfix",[525,1649,644],{"class":542},[525,1651,1652],{"class":850},"\"2 3 + 4 * 5 -\"",[525,1654,1655],{"class":542},") ",[525,1657,1337],{"class":531},[525,1659,1660],{"class":850}," \"",[525,1662,1623],{"class":656},[525,1664,1626],{"class":850},[525,1666,660],{"class":542},[525,1668,1669,1671,1673,1675],{"class":527,"line":610},[525,1670,1130],{"class":542},[525,1672,1133],{"class":538},[525,1674,644],{"class":542},[525,1676,1677],{"class":850},"\"2 3 * 4 2 - \u002F 5 6 * + : \"\n",[525,1679,1680,1682,1684,1686,1689,1691,1693,1695,1697,1699],{"class":527,"line":616},[525,1681,1644],{"class":531},[525,1683,1647],{"class":538},[525,1685,644],{"class":542},[525,1687,1688],{"class":850},"\"2 3 * 4 2 - \u002F 5 6 * +\"",[525,1690,1655],{"class":542},[525,1692,1337],{"class":531},[525,1694,1660],{"class":850},[525,1696,1623],{"class":656},[525,1698,1626],{"class":850},[525,1700,660],{"class":542},[525,1702,1703,1705,1707,1709],{"class":527,"line":621},[525,1704,1130],{"class":542},[525,1706,1133],{"class":538},[525,1708,644],{"class":542},[525,1710,1711],{"class":850},"\"2 4 - 3 ^ 5 + : \"\n",[525,1713,1714,1716,1718,1720,1723,1725,1727,1729,1731,1733],{"class":527,"line":634},[525,1715,1644],{"class":531},[525,1717,1647],{"class":538},[525,1719,644],{"class":542},[525,1721,1722],{"class":850},"\"2 4 - 3 ^ 5 +\"",[525,1724,1655],{"class":542},[525,1726,1337],{"class":531},[525,1728,1660],{"class":850},[525,1730,1623],{"class":656},[525,1732,1626],{"class":850},[525,1734,660],{"class":542},[525,1736,1737,1739,1741,1743,1746],{"class":527,"line":663},[525,1738,1130],{"class":542},[525,1740,1133],{"class":538},[525,1742,644],{"class":542},[525,1744,1745],{"class":850},"\"Done.\"",[525,1747,660],{"class":542},[525,1749,1750],{"class":527,"line":668},[525,1751,613],{"class":542},[525,1753,1754],{"class":527,"line":673},[525,1755,578],{"class":542},[525,1757,1758],{"class":527,"line":694},[525,1759,1761],{"class":1760},"sJ8bj","    \u002F** Evaluates a postfix expression and returns the result. *\u002F\n",[525,1763,1764,1766,1768,1771,1773,1776,1778],{"class":527,"line":705},[525,1765,584],{"class":531},[525,1767,1071],{"class":531},[525,1769,1770],{"class":531}," double",[525,1772,1647],{"class":538},[525,1774,1775],{"class":542},"(String ",[525,1777,1348],{"class":687},[525,1779,691],{"class":542},[525,1781,1782,1784,1787,1790,1792,1794],{"class":527,"line":710},[525,1783,1094],{"class":542},[525,1785,1786],{"class":531},"Double",[525,1788,1789],{"class":542},"> valueStack ",[525,1791,566],{"class":531},[525,1793,569],{"class":531},[525,1795,1106],{"class":542},[525,1797,1798,1801,1804,1806,1809,1812,1814,1817],{"class":527,"line":715},[525,1799,1800],{"class":531},"        String",[525,1802,1803],{"class":542},"[] tokens ",[525,1805,566],{"class":531},[525,1807,1808],{"class":542}," postfix.",[525,1810,1811],{"class":538},"split",[525,1813,644],{"class":542},[525,1815,1816],{"class":850},"\" \"",[525,1818,660],{"class":542},[525,1820,1821],{"class":527,"line":727},[525,1822,578],{"class":542},[525,1824,1825,1828,1831,1834],{"class":527,"line":751},[525,1826,1827],{"class":531},"        for",[525,1829,1830],{"class":542}," (String token ",[525,1832,1833],{"class":531},":",[525,1835,1836],{"class":542}," tokens) {\n",[525,1838,1839,1842,1844,1847],{"class":527,"line":770},[525,1840,1841],{"class":531},"            if",[525,1843,962],{"class":542},[525,1845,1846],{"class":538},"isNumeric",[525,1848,1849],{"class":542},"(token)) {\n",[525,1851,1852,1855,1857,1859,1862,1865],{"class":527,"line":778},[525,1853,1854],{"class":542},"                valueStack.",[525,1856,1118],{"class":538},[525,1858,644],{"class":542},[525,1860,1861],{"class":531},"new",[525,1863,1864],{"class":538}," Double",[525,1866,1867],{"class":542},"(token));\n",[525,1869,1870,1873,1876,1879,1882,1885,1887,1890,1892,1895,1898,1900,1902,1905],{"class":527,"line":783},[525,1871,1872],{"class":542},"            } ",[525,1874,1875],{"class":531},"else",[525,1877,1878],{"class":531}," if",[525,1880,1881],{"class":542}," (token.",[525,1883,1884],{"class":538},"equals",[525,1886,644],{"class":542},[525,1888,1889],{"class":850},"\"+\"",[525,1891,1655],{"class":542},[525,1893,1894],{"class":531},"||",[525,1896,1897],{"class":542}," token.",[525,1899,1884],{"class":538},[525,1901,644],{"class":542},[525,1903,1904],{"class":850},"\"-\"",[525,1906,1907],{"class":542},")\n",[525,1909,1910,1913,1915,1917,1919,1922,1924,1926,1928,1930,1932,1935],{"class":527,"line":788},[525,1911,1912],{"class":531},"                    ||",[525,1914,1897],{"class":542},[525,1916,1884],{"class":538},[525,1918,644],{"class":542},[525,1920,1921],{"class":850},"\"*\"",[525,1923,1655],{"class":542},[525,1925,1894],{"class":531},[525,1927,1897],{"class":542},[525,1929,1884],{"class":538},[525,1931,644],{"class":542},[525,1933,1934],{"class":850},"\"\u002F\"",[525,1936,1907],{"class":542},[525,1938,1939,1941,1943,1945,1947,1950],{"class":527,"line":801},[525,1940,1912],{"class":531},[525,1942,1897],{"class":542},[525,1944,1884],{"class":538},[525,1946,644],{"class":542},[525,1948,1949],{"class":850},"\"^\"",[525,1951,1952],{"class":542},")) {\n",[525,1954,1955,1958,1960,1963,1965,1968],{"class":527,"line":813},[525,1956,1957],{"class":542},"                Double operandTwo ",[525,1959,566],{"class":531},[525,1961,1962],{"class":542}," valueStack.",[525,1964,722],{"class":538},[525,1966,1967],{"class":542},"();   ",[525,1969,1970],{"class":1760},"\u002F\u002F right operand\n",[525,1972,1973,1976,1978,1980,1982,1984],{"class":527,"line":818},[525,1974,1975],{"class":542},"                Double operandOne ",[525,1977,566],{"class":531},[525,1979,1962],{"class":542},[525,1981,722],{"class":538},[525,1983,1967],{"class":542},[525,1985,1986],{"class":1760},"\u002F\u002F left operand\n",[525,1988,1989,1992,1994,1997],{"class":527,"line":823},[525,1990,1991],{"class":542},"                Double result ",[525,1993,566],{"class":531},[525,1995,1996],{"class":538}," compute",[525,1998,1999],{"class":542},"(operandOne, operandTwo, token);\n",[525,2001,2002,2004,2006],{"class":527,"line":832},[525,2003,1854],{"class":542},[525,2005,1118],{"class":538},[525,2007,2008],{"class":542},"(result);\n",[525,2010,2011],{"class":527,"line":845},[525,2012,2013],{"class":542},"            }\n",[525,2015,2016],{"class":527,"line":863},[525,2017,2018],{"class":542},"        }\n",[525,2020,2021],{"class":527,"line":868},[525,2022,578],{"class":542},[525,2024,2026,2028,2030,2032],{"class":527,"line":2025},31,[525,2027,599],{"class":531},[525,2029,1962],{"class":542},[525,2031,629],{"class":538},[525,2033,607],{"class":542},[525,2035,2037],{"class":527,"line":2036},32,[525,2038,613],{"class":542},[525,2040,2042],{"class":527,"line":2041},33,[525,2043,578],{"class":542},[525,2045,2047,2049,2051,2053,2056,2058,2061],{"class":527,"line":2046},34,[525,2048,584],{"class":531},[525,2050,1071],{"class":531},[525,2052,793],{"class":531},[525,2054,2055],{"class":538}," isNumeric",[525,2057,1775],{"class":542},[525,2059,2060],{"class":687},"str",[525,2062,691],{"class":542},[525,2064,2066,2069],{"class":527,"line":2065},35,[525,2067,2068],{"class":531},"        try",[525,2070,1064],{"class":542},[525,2072,2074,2077,2080,2082,2085,2088],{"class":527,"line":2073},36,[525,2075,2076],{"class":531},"            double",[525,2078,2079],{"class":542}," d ",[525,2081,566],{"class":531},[525,2083,2084],{"class":542}," Double.",[525,2086,2087],{"class":538},"parseDouble",[525,2089,2090],{"class":542},"(str);\n",[525,2092,2094,2097,2100,2103,2106],{"class":527,"line":2093},37,[525,2095,2096],{"class":542},"        } ",[525,2098,2099],{"class":531},"catch",[525,2101,2102],{"class":542}," (NumberFormatException ",[525,2104,2105],{"class":687},"nfe",[525,2107,691],{"class":542},[525,2109,2111,2114,2117],{"class":527,"line":2110},38,[525,2112,2113],{"class":531},"            return",[525,2115,2116],{"class":656}," false",[525,2118,2119],{"class":542},";\n",[525,2121,2123],{"class":527,"line":2122},39,[525,2124,2018],{"class":542},[525,2126,2128,2130,2133],{"class":527,"line":2127},40,[525,2129,599],{"class":531},[525,2131,2132],{"class":656}," true",[525,2134,2119],{"class":542},[525,2136,2138],{"class":527,"line":2137},41,[525,2139,613],{"class":542},[525,2141,2143],{"class":527,"line":2142},42,[525,2144,578],{"class":542},[525,2146,2148,2150,2152,2155,2158,2161,2164,2167,2170],{"class":527,"line":2147},43,[525,2149,555],{"class":531},[525,2151,1071],{"class":531},[525,2153,2154],{"class":542}," Double ",[525,2156,2157],{"class":538},"compute",[525,2159,2160],{"class":542},"(Double ",[525,2162,2163],{"class":687},"operandOne",[525,2165,2166],{"class":542},", Double ",[525,2168,2169],{"class":687},"operandTwo",[525,2171,2172],{"class":542},",\n",[525,2174,2176,2179,2182],{"class":527,"line":2175},44,[525,2177,2178],{"class":542},"                                  String ",[525,2180,2181],{"class":687},"operator",[525,2183,691],{"class":542},[525,2185,2187,2190],{"class":527,"line":2186},45,[525,2188,2189],{"class":531},"        double",[525,2191,2192],{"class":542}," result;\n",[525,2194,2196,2199],{"class":527,"line":2195},46,[525,2197,2198],{"class":531},"        switch",[525,2200,2201],{"class":542}," (operator) {\n",[525,2203,2205,2208,2211,2213,2216,2218,2221,2223,2226,2229],{"class":527,"line":2204},47,[525,2206,2207],{"class":531},"            case",[525,2209,2210],{"class":850}," \"+\"",[525,2212,1833],{"class":531},[525,2214,2215],{"class":542}," result ",[525,2217,566],{"class":531},[525,2219,2220],{"class":542}," operandOne ",[525,2222,1337],{"class":531},[525,2224,2225],{"class":542}," operandTwo; ",[525,2227,2228],{"class":531},"break",[525,2230,2119],{"class":542},[525,2232,2234,2236,2239,2241,2243,2245,2247,2249,2251,2253],{"class":527,"line":2233},48,[525,2235,2207],{"class":531},[525,2237,2238],{"class":850}," \"-\"",[525,2240,1833],{"class":531},[525,2242,2215],{"class":542},[525,2244,566],{"class":531},[525,2246,2220],{"class":542},[525,2248,653],{"class":531},[525,2250,2225],{"class":542},[525,2252,2228],{"class":531},[525,2254,2119],{"class":542},[525,2256,2258,2260,2263,2265,2267,2269,2271,2273,2275,2277],{"class":527,"line":2257},49,[525,2259,2207],{"class":531},[525,2261,2262],{"class":850}," \"*\"",[525,2264,1833],{"class":531},[525,2266,2215],{"class":542},[525,2268,566],{"class":531},[525,2270,2220],{"class":542},[525,2272,1424],{"class":531},[525,2274,2225],{"class":542},[525,2276,2228],{"class":531},[525,2278,2119],{"class":542},[525,2280,2282,2284,2287,2289,2291,2293,2295,2298,2300,2302],{"class":527,"line":2281},50,[525,2283,2207],{"class":531},[525,2285,2286],{"class":850}," \"\u002F\"",[525,2288,1833],{"class":531},[525,2290,2215],{"class":542},[525,2292,566],{"class":531},[525,2294,2220],{"class":542},[525,2296,2297],{"class":531},"\u002F",[525,2299,2225],{"class":542},[525,2301,2228],{"class":531},[525,2303,2119],{"class":542},[525,2305,2307,2309,2312,2314,2316,2318,2321,2324,2327,2329],{"class":527,"line":2306},51,[525,2308,2207],{"class":531},[525,2310,2311],{"class":850}," \"^\"",[525,2313,1833],{"class":531},[525,2315,2215],{"class":542},[525,2317,566],{"class":531},[525,2319,2320],{"class":542}," Math.",[525,2322,2323],{"class":538},"pow",[525,2325,2326],{"class":542},"(operandOne, operandTwo); ",[525,2328,2228],{"class":531},[525,2330,2119],{"class":542},[525,2332,2334,2337,2340,2342,2345,2348,2350,2353],{"class":527,"line":2333},52,[525,2335,2336],{"class":531},"            default:",[525,2338,2339],{"class":542},"  result ",[525,2341,566],{"class":531},[525,2343,2344],{"class":656}," 0",[525,2346,2347],{"class":542},"; ",[525,2349,2228],{"class":531},[525,2351,2352],{"class":542},";  ",[525,2354,2355],{"class":1760},"\u002F\u002F unexpected character\n",[525,2357,2359],{"class":527,"line":2358},53,[525,2360,2018],{"class":542},[525,2362,2364,2366],{"class":527,"line":2363},54,[525,2365,599],{"class":531},[525,2367,2192],{"class":542},[525,2369,2371],{"class":527,"line":2370},55,[525,2372,613],{"class":542},[525,2374,2376],{"class":527,"line":2375},56,[525,2377,871],{"class":542},[16,2379,1290],{},[43,2381,2384],{"className":2382,"code":2383,"language":48},[46],"Testing PostfixEvaluation:\n \n2 3 + 4 * 5 - : 15.0\n \n2 3 * 4 2 - \u002F 5 6 * + : 33.0\n \n2 4 - 3 ^ 5 + : -3.0\n \nDone.\n",[25,2385,2383],{"__ignoreMap":51},[76,2387,2389],{"id":2388},"the-critical-pop-order","The Critical Pop Order",[16,2391,2392],{},"One thing I want to highlight, because it's a common bug:",[43,2394,2396],{"className":519,"code":2395,"language":521,"meta":51,"style":51},"Double operandTwo = valueStack.pop();   \u002F\u002F FIRST pop = RIGHT operand\nDouble operandOne = valueStack.pop();   \u002F\u002F SECOND pop = LEFT operand\n",[25,2397,2398,2414],{"__ignoreMap":51},[525,2399,2400,2403,2405,2407,2409,2411],{"class":527,"line":528},[525,2401,2402],{"class":542},"Double operandTwo ",[525,2404,566],{"class":531},[525,2406,1962],{"class":542},[525,2408,722],{"class":538},[525,2410,1967],{"class":542},[525,2412,2413],{"class":1760},"\u002F\u002F FIRST pop = RIGHT operand\n",[525,2415,2416,2419,2421,2423,2425,2427],{"class":527,"line":552},[525,2417,2418],{"class":542},"Double operandOne ",[525,2420,566],{"class":531},[525,2422,1962],{"class":542},[525,2424,722],{"class":538},[525,2426,1967],{"class":542},[525,2428,2429],{"class":1760},"\u002F\u002F SECOND pop = LEFT operand\n",[16,2431,2432,2433,207],{},"Why does order matter? Because subtraction and division aren't commutative. ",[25,2434,2435],{},"5 - 3 ≠ 3 - 5",[16,2437,2438,2439,2442,2443,2446,2447,2450,2451,2454,2455,2458],{},"When evaluating ",[25,2440,2441],{},"5 3 -",", you push 5, then push 3. The first thing you pop is ",[20,2444,2445],{},"3",", which is the ",[134,2448,2449],{},"right"," side of the subtraction (",[25,2452,2453],{},"5 - 3","). The second pop is ",[20,2456,2457],{},"5",", the left side. Get this wrong and your calculator returns negative answers for everything.",[11,2460,2462],{"id":2461},"wrap-up","Wrap-Up",[16,2464,2465],{},"Let's recap what we covered:",[87,2467,2468,2476,2482,2493,2503,2514,2517,2520,2523,2526,2529],{},[90,2469,82,2470,2473,2474,207],{},[20,2471,2472],{},"stack"," is a list restricted to insertions and deletions at one end — the ",[20,2475,180],{},[90,2477,2478,2479,2481],{},"It follows the ",[20,2480,202],{}," principle: last in, first out.",[90,2483,2484,2485,28,2487,2489,2490,2492],{},"The core operations are ",[25,2486,1118],{},[25,2488,722],{},", and ",[25,2491,629],{},", all of which are O(1).",[90,2494,2495,2496,2498,2499,2502],{},"We implement stacks efficiently using an ",[20,2497,464],{},", preferably via ",[20,2500,2501],{},"composition"," rather than inheritance, so we don't accidentally expose list operations that violate the stack discipline.",[90,2504,2505,2506,2509,2510,2513],{},"A classic application is evaluating ",[20,2507,2508],{},"postfix expressions"," (Reverse Polish Notation). The algorithm is short and elegant, and the stack's state at any point also helps detect malformed input.\nStacks show up ",[134,2511,2512],{},"everywhere"," once you start looking:",[90,2515,2516],{},"Function call stacks in every programming language",[90,2518,2519],{},"Undo\u002Fredo systems",[90,2521,2522],{},"Browser history",[90,2524,2525],{},"Expression parsing in compilers",[90,2527,2528],{},"Backtracking algorithms (think: solving a maze)",[90,2530,2531,2532,2535],{},"Balanced parenthesis checking\nNext time you press ",[25,2533,2534],{},"Ctrl+Z",", give a small nod to the stack working quietly behind the scenes.",[2537,2538,2539],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":51,"searchDepth":552,"depth":552,"links":2541},[2542,2545,2550,2557,2567],{"id":13,"depth":552,"text":14,"children":2543},[2544],{"id":78,"depth":575,"text":79},{"id":164,"depth":552,"text":165,"children":2546},[2547,2548,2549],{"id":187,"depth":575,"text":188},{"id":236,"depth":575,"text":237},{"id":337,"depth":575,"text":338},{"id":394,"depth":552,"text":395,"children":2551},[2552,2553,2554,2555,2556],{"id":401,"depth":575,"text":402},{"id":442,"depth":575,"text":443},{"id":512,"depth":575,"text":513},{"id":922,"depth":575,"text":923},{"id":1046,"depth":575,"text":1047},{"id":1310,"depth":552,"text":1311,"children":2558},[2559,2560,2561,2562,2564,2565,2566],{"id":1317,"depth":575,"text":1318},{"id":1389,"depth":575,"text":1390},{"id":1471,"depth":575,"text":1472},{"id":1487,"depth":575,"text":2563},"Worked Example: Evaluating 4 3 5 * +",{"id":1513,"depth":575,"text":1514},{"id":1565,"depth":575,"text":1566},{"id":2388,"depth":575,"text":2389},{"id":2461,"depth":552,"text":2462},"2026-05-13",false,"md",null,{},true,"\u002Fblog\u002FStack",{"title":5,"description":51},{"loc":2574},"blog\u002FStack","R89ZmsiP_zrhtZiUv8rCKK73up-WbXaX-SKBDAd2c_o",116,{"id":2581,"extension":2582,"meta":2583,"series":2584,"stem":2694,"__hash__":2695},"series\u002Fseries.json","json",{},{"微積分教學":2585,"生活紀錄":2588,"Motor Control":2590,"生活隨筆":2604,"Motor learning":2608,"小兒物治":2626,"中風":2641,"平衡":2654,"Network Communication":2664,"CSA":2671,"機器學習":2677,"小腦":2681,"SCI脊髓損傷":2690},[2586,2587],"微積分隨筆-未完成版","2025數學回顧",[2589],"一個漂流到地球的故事",[2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603],"控制自己-Be-water-my-friend","控制自己-Be-water-my-friend（二）","控制自己-Be-water-my-friend（三）","控制自己-Be-water-my-friend（四）","控制自己-Be-water-my-friend（五）","進階控制制制制","周圍理論學派（一）反射理論","周圍理論學派（二）階層理論","中樞理論學派（一）CPG","中樞理論學派（二）Motor-Program","模組理論","系統理論","動態模組理論",[2605,2606,2607],"你好，世界。","根本沒人在乎你的部落格","早安-午安-晚安",[2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625],"動作學習（一）介紹","動作學習（二）form-of-learning","動作學習（三）Measurement-of-learning","動作學習（四）理論","動作學習（五）理論-2","動作學習（六）理論-3","動作學習（七）練習方式-1","動作學習（八）練習方式-2","動作學習（九）回饋-1","動作學習（十）回饋-2-擴增性(KR)","動作學習（十一）回饋-3-擴增性(KP)","動作學習（十一）回饋-4-(間隔+物理引導)","動作學習（十二）神經可塑性","動作學習（十二）神經可塑性2","動作學習（十三）臨床應用","動作學習（十四）記憶","動作學習（十五）影響表現的因素",[2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640],"腦性痲痺-CP","CP補充（一）","CP—Rood-&-Bobath","CP—Rood-&-Bobath（二）","Motor-Learning","Motor-Learning小兒（二）","Gait-analysis小兒（一）","Gait-analysis小兒（二）","小兒發展（一）","小兒發展（二）","小兒發展（三）","小兒發展（四）","小兒發展（五）","GMFCS",[2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653],"腦血管病變（CVA）（中風）(一)","CVA（二）","CVA（三）血管症候群-i","CVA（四）血管症候群-(ii)","CVA（四）","CVA（六）","CVA（七）評估-(i)","CVA（八）評估-(ii)","CVA（九）復健—手部-(i)","CVA（十）功能性走路","CVA（十一）功能性走路ii","CVA（十二）輔助用品",[2655,2656,2657,2658,2659,2660,2661,2662,2663],"平衡與前庭失調（一）","Balance（二）前庭覺-(i)","Balance（三）","Balance（四）評估","Balance（五）復健","Balance（六）功能恢復","Balance（七）前庭障礙","Balance（八）檢查","Balance（九）干預",[2665,2666,2667,2668,2669,2670],"Network-Communication,-Chapter-1","Network-Communication,-Chapter-2","Network-Communication,-Chapter-3","Network-Communication-Chapter-4","Network-Communications,-Chapter-5","Network-Communication,-Chapter-6",[2672,2673,2674,2675,2676],"Week-1-—-Introduction-to-Computer-Systems","Computer-Systems-Architecture-Understanding-Performance","A-Top-Level-View-of-Computer-Function-and-Interconnection","The-Memory-Hierarchy-Understanding-Cache-Memory","Internal-Memory-How-Your-Computer-Remembers-Things",[2678,2679,2680],"機器學習導論","資料前處理與迴歸分析","決策樹",[2682,2683,2684,2685,2686,2687,2688,2689],"小腦（一）","小腦（二）","小腦（三）功能","小腦（四）損傷","小腦（五）各功能障礙","小腦（六）評估","小腦（七）評估(ii)","小腦（八）治療",[2691,2692,2693],"脊髓損傷SCI（一）","SCI（二）受傷機制——創傷性（頸椎）","SCI（三）受傷機制--ii","series","OrQkztaCQ8PCQ3c33l2XQ4ZKtA6mZbR3LOKgfR0KR_M",[2697,2716,2736,2755,2772,2789,2804,2821,2839,2861],{"id":2698,"title":2699,"avatar":2700,"banner":2571,"bio":2701,"body":2702,"description":51,"extension":2570,"meta":2706,"name":2699,"navigation":2573,"path":2707,"seo":2708,"sitemap":2709,"social":2710,"stem":2714,"__hash__":2715},"authors\u002Fauthors\u002Fautomata.md","Automata","\u002Fimages\u002Fuploads\u002Fnier-automata-2b.jpg","一隻吐司天喵，漂浮在銀河星辰中",{"type":8,"value":2703,"toc":2704},[],{"title":51,"searchDepth":552,"depth":552,"links":2705},[],{},"\u002Fauthors\u002Fautomata",{"description":51},{"loc":2707},{"website":2711,"twitter":2712,"github":2713},"https:\u002F\u002Freurl.cc\u002FWOeM29","https:\u002F\u002Freurl.cc\u002FLnvLEy","https:\u002F\u002Fgithub.com\u002FAutomata-0","authors\u002Fautomata","IkVbO2zA7revgYq624iVWpSZQUyMmWa82tw_EbWXViE",{"id":2717,"title":2718,"avatar":2719,"banner":2720,"bio":2721,"body":2722,"description":51,"extension":2570,"meta":2726,"name":2727,"navigation":2573,"path":2728,"seo":2729,"sitemap":2730,"social":2731,"stem":2734,"__hash__":2735},"authors\u002Fauthors\u002Fchinono.md","Chinono","\u002Fimages\u002Fuploads\u002F103467998_p0 copy.png","\u002Fimages\u002Fbackground_light.jpg","我不是女生！",{"type":8,"value":2723,"toc":2724},[],{"title":51,"searchDepth":552,"depth":552,"links":2725},[],{},"七糯糯","\u002Fauthors\u002Fchinono",{"description":51},{"loc":2728},{"github":2732,"twitter":51,"website":2733},"https:\u002F\u002Fgithub.com\u002FChinHongTan","https:\u002F\u002Fchinono.dev","authors\u002Fchinono","jj1J9mFh3InZFL6XtCzGBQ5jPip0EwBDE3mjGvnN6jE",{"id":2737,"title":2738,"avatar":2739,"banner":2740,"bio":2741,"body":2742,"description":51,"extension":2570,"meta":2746,"name":2747,"navigation":2573,"path":2748,"seo":2749,"sitemap":2750,"social":2751,"stem":2753,"__hash__":2754},"authors\u002Fauthors\u002Fhibiki12141132.md","Hibiki12141132","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F265822020?v=4","\u002Fimages\u002Fuploads\u002F1773978423557-___.jpg","享受著知識強姦大腦的過程 (內文含個人發癲 不要再意)",{"type":8,"value":2743,"toc":2744},[],{"title":51,"searchDepth":552,"depth":552,"links":2745},[],{},"HiBiKi","\u002Fauthors\u002Fhibiki12141132",{"description":51},{"loc":2748},{"github":2752,"twitter":51},"https:\u002F\u002Fgithub.com\u002FHiBiKi12141132","authors\u002Fhibiki12141132","dbRnKEcYeCH_faD8R7AUmPPcwgc26s_fR4Q_lu4qtA4",{"id":2756,"title":2757,"avatar":2758,"banner":2571,"bio":2759,"body":2760,"description":51,"extension":2570,"meta":2764,"name":2757,"navigation":2573,"path":2765,"seo":2766,"sitemap":2767,"social":2768,"stem":2770,"__hash__":2771},"authors\u002Fauthors\u002Fmahiro.md","Mahiro","https:\u002F\u002Ftruth.bahamut.com.tw\u002Fs01\u002F202601\u002F2a29b047d341f840b2ce89f7d65b2ba3.JPG","一個致力於逃離新竹的電機系小雜魚",{"type":8,"value":2761,"toc":2762},[],{"title":51,"searchDepth":552,"depth":552,"links":2763},[],{},"\u002Fauthors\u002Fmahiro",{"description":51},{"loc":2765},{"github":2769},"https:\u002F\u002Fgithub.com\u002Fwifekurumi","authors\u002Fmahiro","b435tdWu9eXUf06WroCge0I405cqA0FhLlUUhoPk14k",{"id":2773,"title":2774,"avatar":2775,"banner":2571,"bio":2776,"body":2777,"description":51,"extension":2570,"meta":2781,"name":2774,"navigation":2573,"path":2782,"seo":2783,"sitemap":2784,"social":2785,"stem":2787,"__hash__":2788},"authors\u002Fauthors\u002Fosborrrrn.md","Osborrrrn","\u002Fimages\u002Fuploads\u002Frectangle_large_type_2_c516437ed713e5de1f7d2dca8a20cd81.jpg","別人笑我太瘋癲，我笑他人看不穿。\n不見五陵豪傑墓，無花無酒鋤就田",{"type":8,"value":2778,"toc":2779},[],{"title":51,"searchDepth":552,"depth":552,"links":2780},[],{},"\u002Fauthors\u002Fosborrrrn",{"description":51},{"loc":2782},{"github":2786},"https:\u002F\u002Fgithub.com\u002FOsborrrrn","authors\u002Fosborrrrn","w6VWZKPUwvXn5i7MKXOpU2Jeqr3BrdTKVCeDOF2jZlU",{"id":2790,"title":2791,"avatar":2571,"banner":2571,"bio":2792,"body":2793,"description":51,"extension":2570,"meta":2797,"name":2791,"navigation":2573,"path":2798,"seo":2799,"sitemap":2800,"social":2801,"stem":2802,"__hash__":2803},"authors\u002Fauthors\u002F法法.md","法法","123",{"type":8,"value":2794,"toc":2795},[],{"title":51,"searchDepth":552,"depth":552,"links":2796},[],{},"\u002Fauthors\u002F法法",{"description":51},{"loc":2798},{"github":51},"authors\u002F法法","o5pdVuPCfTmhkDCpvgy4YmAP0CGdvFluPvjhgvQVbsI",{"id":2805,"title":2806,"avatar":2807,"banner":2571,"bio":2808,"body":2809,"description":51,"extension":2570,"meta":2813,"name":2806,"navigation":2573,"path":2814,"seo":2815,"sitemap":2816,"social":2817,"stem":2819,"__hash__":2820},"authors\u002Fauthors\u002F灰海獅.md","灰海獅","\u002Fimages\u002Fuploads\u002Fimg_3279.jpeg","守夜人",{"type":8,"value":2810,"toc":2811},[],{"title":51,"searchDepth":552,"depth":552,"links":2812},[],{},"\u002Fauthors\u002F灰海獅",{"description":51},{"loc":2814},{"github":2818},"https:\u002F\u002Fgithub.com\u002Fyuiri333","authors\u002F灰海獅","iZoSIFbQdS-6v3LiK1txgxnIMKy-d2CyZXQk9CMua_s",{"id":2822,"title":2823,"avatar":2824,"banner":2825,"bio":2826,"body":2827,"description":51,"extension":2570,"meta":2831,"name":2823,"navigation":2573,"path":2832,"seo":2833,"sitemap":2834,"social":2835,"stem":2837,"__hash__":2838},"authors\u002Fauthors\u002F花夜.md","花夜","\u002Fimages\u002Fuploads\u002F1772719470518-791_20260218161129.png","\u002Fimages\u002Fuploads\u002Fimg_2446.png","無論你身在何處，我都會在這裡等你",{"type":8,"value":2828,"toc":2829},[],{"title":51,"searchDepth":552,"depth":552,"links":2830},[],{},"\u002Fauthors\u002F花夜",{"description":51},{"loc":2832},{"github":2836,"twitter":51},"https:\u002F\u002Fgithub.com\u002Fflowernight0709","authors\u002F花夜","a7jeQiF_JkawgYIR-aYSGceJdDP6Z-OWydsICvgSIzs",{"id":2840,"title":2841,"avatar":2842,"banner":2843,"bio":2844,"body":2845,"description":2849,"extension":2570,"meta":2852,"name":2841,"navigation":2573,"path":2853,"seo":2854,"sitemap":2855,"social":2856,"stem":2859,"__hash__":2860},"authors\u002Fauthors\u002F輝月.md","輝月","\u002Fimages\u002Fuploads\u002Ffb_img_1771085634823.jpg","\u002Fimages\u002Fuploads\u002Fimg_1751.jpg","天下布魔好好玩",{"type":8,"value":2846,"toc":2850},[2847],[16,2848,2849],{},"準大學生，目前正在製作TFR模組",{"title":51,"searchDepth":552,"depth":552,"links":2851},[],{},"\u002Fauthors\u002F輝月",{"description":2849},{"loc":2853},{"twitter":2857,"github":2858},"https:\u002F\u002Fx.com\u002Fhuiyue945","https:\u002F\u002Fgithub.com\u002Fhuiyueyea","authors\u002F輝月","koUocBihphDy3453-nAcolM7JJYwI7UMBpVkf1JQrMQ",{"id":2862,"title":2863,"avatar":2864,"banner":2571,"bio":2865,"body":2866,"description":2870,"extension":2570,"meta":2883,"name":2863,"navigation":2573,"path":2884,"seo":2885,"sitemap":2886,"social":2887,"stem":2889,"__hash__":2890},"authors\u002Fauthors\u002F阿西狄亞.md","阿西狄亞","\u002Fimages\u002Fuploads\u002Fimg_20251215_121849_589.jpg","君は実に馬鹿だな",{"type":8,"value":2867,"toc":2881},[2868,2871],[16,2869,2870],{},"我是阿西狄亞，阿西狄亞的阿，阿西狄亞的西，阿西狄亞的狄，阿西狄亞的亞，你可以叫我阿西。",[16,2872,2873,2876,2877,2880],{},[20,2874,2875],{},"我說的所有事情都抱有極度主觀的看法以及意見","，如果你有其他想法，",[20,2878,2879],{},"你是對的","。",{"title":51,"searchDepth":552,"depth":552,"links":2882},[],{},"\u002Fauthors\u002F阿西狄亞",{"description":2870},{"loc":2884},{"github":2888},"https:\u002F\u002Fgithub.com\u002FAcedia0130","authors\u002F阿西狄亞","q5ECEDl8-0Y33tPck0lYZnzPjFdJkrOnBN7HkAO3pls",[],[2893,2902,2911,2920,2929,2938,2947,2956,2965,2976],{"id":2698,"title":2699,"avatar":2700,"banner":2571,"bio":2701,"body":2894,"description":51,"extension":2570,"meta":2898,"name":2699,"navigation":2573,"path":2707,"seo":2899,"sitemap":2900,"social":2901,"stem":2714,"__hash__":2715},{"type":8,"value":2895,"toc":2896},[],{"title":51,"searchDepth":552,"depth":552,"links":2897},[],{},{"description":51},{"loc":2707},{"website":2711,"twitter":2712,"github":2713},{"id":2717,"title":2718,"avatar":2719,"banner":2720,"bio":2721,"body":2903,"description":51,"extension":2570,"meta":2907,"name":2727,"navigation":2573,"path":2728,"seo":2908,"sitemap":2909,"social":2910,"stem":2734,"__hash__":2735},{"type":8,"value":2904,"toc":2905},[],{"title":51,"searchDepth":552,"depth":552,"links":2906},[],{},{"description":51},{"loc":2728},{"github":2732,"twitter":51,"website":2733},{"id":2737,"title":2738,"avatar":2739,"banner":2740,"bio":2741,"body":2912,"description":51,"extension":2570,"meta":2916,"name":2747,"navigation":2573,"path":2748,"seo":2917,"sitemap":2918,"social":2919,"stem":2753,"__hash__":2754},{"type":8,"value":2913,"toc":2914},[],{"title":51,"searchDepth":552,"depth":552,"links":2915},[],{},{"description":51},{"loc":2748},{"github":2752,"twitter":51},{"id":2756,"title":2757,"avatar":2758,"banner":2571,"bio":2759,"body":2921,"description":51,"extension":2570,"meta":2925,"name":2757,"navigation":2573,"path":2765,"seo":2926,"sitemap":2927,"social":2928,"stem":2770,"__hash__":2771},{"type":8,"value":2922,"toc":2923},[],{"title":51,"searchDepth":552,"depth":552,"links":2924},[],{},{"description":51},{"loc":2765},{"github":2769},{"id":2773,"title":2774,"avatar":2775,"banner":2571,"bio":2776,"body":2930,"description":51,"extension":2570,"meta":2934,"name":2774,"navigation":2573,"path":2782,"seo":2935,"sitemap":2936,"social":2937,"stem":2787,"__hash__":2788},{"type":8,"value":2931,"toc":2932},[],{"title":51,"searchDepth":552,"depth":552,"links":2933},[],{},{"description":51},{"loc":2782},{"github":2786},{"id":2790,"title":2791,"avatar":2571,"banner":2571,"bio":2792,"body":2939,"description":51,"extension":2570,"meta":2943,"name":2791,"navigation":2573,"path":2798,"seo":2944,"sitemap":2945,"social":2946,"stem":2802,"__hash__":2803},{"type":8,"value":2940,"toc":2941},[],{"title":51,"searchDepth":552,"depth":552,"links":2942},[],{},{"description":51},{"loc":2798},{"github":51},{"id":2805,"title":2806,"avatar":2807,"banner":2571,"bio":2808,"body":2948,"description":51,"extension":2570,"meta":2952,"name":2806,"navigation":2573,"path":2814,"seo":2953,"sitemap":2954,"social":2955,"stem":2819,"__hash__":2820},{"type":8,"value":2949,"toc":2950},[],{"title":51,"searchDepth":552,"depth":552,"links":2951},[],{},{"description":51},{"loc":2814},{"github":2818},{"id":2822,"title":2823,"avatar":2824,"banner":2825,"bio":2826,"body":2957,"description":51,"extension":2570,"meta":2961,"name":2823,"navigation":2573,"path":2832,"seo":2962,"sitemap":2963,"social":2964,"stem":2837,"__hash__":2838},{"type":8,"value":2958,"toc":2959},[],{"title":51,"searchDepth":552,"depth":552,"links":2960},[],{},{"description":51},{"loc":2832},{"github":2836,"twitter":51},{"id":2840,"title":2841,"avatar":2842,"banner":2843,"bio":2844,"body":2966,"description":2849,"extension":2570,"meta":2972,"name":2841,"navigation":2573,"path":2853,"seo":2973,"sitemap":2974,"social":2975,"stem":2859,"__hash__":2860},{"type":8,"value":2967,"toc":2970},[2968],[16,2969,2849],{},{"title":51,"searchDepth":552,"depth":552,"links":2971},[],{},{"description":2849},{"loc":2853},{"twitter":2857,"github":2858},{"id":2862,"title":2863,"avatar":2864,"banner":2571,"bio":2865,"body":2977,"description":2870,"extension":2570,"meta":2989,"name":2863,"navigation":2573,"path":2884,"seo":2990,"sitemap":2991,"social":2992,"stem":2889,"__hash__":2890},{"type":8,"value":2978,"toc":2987},[2979,2981],[16,2980,2870],{},[16,2982,2983,2876,2985,2880],{},[20,2984,2875],{},[20,2986,2879],{},{"title":51,"searchDepth":552,"depth":552,"links":2988},[],{},{"description":2870},{"loc":2884},{"github":2888},1778690569809]