[{"data":1,"prerenderedAt":2915},["ShallowReactive",2],{"\u002Fblog\u002FAbstract-Data-Types-&-The-Bag":3,"post-count":2501,"series-global-data":2502,"authors-all":2618,"series-sidebar-none":2813,"sidebar-authors":2814},{"id":4,"title":5,"author":6,"body":7,"date":2488,"description":2489,"draft":2490,"edited_at":2491,"extension":2492,"featured_image":2493,"meta":2494,"navigation":2495,"path":2496,"pinned":2490,"seo":2497,"sitemap":2498,"stem":2499,"tags":2493,"__hash__":2500},"blog\u002Fblog\u002FAbstract-Data-Types-&-The-Bag.md","Abstract Data Types & The Bag","chinono",{"type":8,"value":9,"toc":2461},"minimark",[10,32,35,51,56,61,64,105,109,112,139,152,156,163,183,195,198,224,228,231,316,319,361,365,368,408,412,415,459,463,466,483,487,493,497,500,527,534,537,541,544,597,601,612,622,631,635,642,648,662,665,787,791,801,849,869,873,880,1213,1220,1224,1230,1241,1247,1251,1257,1623,1626,1632,1639,1643,1799,1802,2060,2063,2069,2085,2089,2095,2149,2152,2160,2166,2288,2295,2299,2302,2404,2418,2422,2425,2457],[11,12,13,14,18,19,23,24,27,28,31],"p",{},"If you're new to data structures, the very first hurdle isn't a fancy algorithm — it's a way of ",[15,16,17],"em",{},"thinking",". Programmers separate ",[20,21,22],"strong",{},"what"," a thing does from ",[20,25,26],{},"how"," it's built. That's the whole idea behind an ",[20,29,30],{},"Abstract Data Type (ADT)",", and once it clicks, the rest of the course starts to feel much more organized.",[11,33,34],{},"In this post, we'll cover two things:",[36,37,38,45],"ol",{},[39,40,41,44],"li",{},[20,42,43],{},"What an ADT actually is"," (and how it differs from a data structure).",[39,46,47,50],{},[20,48,49],{},"The Bag"," — one of the simplest possible ADTs, and a great way to see all of this in action.\nLet's go.",[52,53,55],"h2",{"id":54},"part-1-abstract-data-types-adts","Part 1: Abstract Data Types (ADTs)",[57,58,60],"h3",{"id":59},"data-is-everywhere-and-we-already-organize-it","Data is everywhere — and we already organize it",[11,62,63],{},"Before we touch any code, look around you. Real-world data is already structured in ways you use every day:",[65,66,67,74,80,86,92],"ul",{},[39,68,69,70,73],{},"A ",[20,71,72],{},"to-do list"," — items in some order, you add and cross off.",[39,75,69,76,79],{},[20,77,78],{},"dictionary"," — words you can look up quickly.",[39,81,69,82,85],{},[20,83,84],{},"stack of books"," — you take from the top.",[39,87,69,88,91],{},[20,89,90],{},"queue for tickets"," — first in, first out.",[39,93,69,94,97,98,101,102,104],{},[20,95,96],{},"road map"," — connections between places.\nEach of these is a ",[15,99,100],{},"collection of things"," with rules about how you add to it, remove from it, and look stuff up. Programmers do the exact same thing with data — and the formal name for these patterns is an ",[20,103,30],{},".",[57,106,108],{"id":107},"collection-vs-container","Collection vs. Container",[11,110,111],{},"These two words get used a lot, and they're easy to mix up:",[65,113,114,129],{},[39,115,69,116,119,120,123,124,126,127,104],{},[20,117,118],{},"collection"," is a general idea — ",[15,121,122],{},"\"a group of objects with some operations.\""," It says ",[20,125,22],{}," you can do (add, remove, search), not ",[20,128,26],{},[39,130,69,131,134,135,138],{},[20,132,133],{},"container"," is the actual ",[20,136,137],{},"class"," in a programming language that implements a collection. It's the concrete thing.",[140,141,142],"blockquote",{},[11,143,144,145,148,149,104],{},"Think of \"collection\" as the ",[15,146,147],{},"concept"," and \"container\" as the ",[15,150,151],{},"code",[57,153,155],{"id":154},"so-what-exactly-is-an-adt","So what exactly is an ADT?",[11,157,158,159,162],{},"An ",[20,160,161],{},"ADT is a conceptual model"," that defines two things:",[36,164,165,171],{},[39,166,167,170],{},[20,168,169],{},"The type of data"," it stores.",[39,172,173,176,177,179,180,182],{},[20,174,175],{},"The operations"," that can be performed on that data.\nAnd critically, it says nothing about ",[20,178,26],{}," any of it is implemented. No arrays, no linked lists, no Java — just ",[15,181,22],{}," the thing does.",[140,184,185],{},[11,186,187,190,191,194],{},[15,188,189],{},"Abstract"," here means ",[20,192,193],{},"irrelevant details are ignored"," — like how the data is stored in memory, or what algorithm runs underneath.",[11,196,197],{},"A useful way to phrase it:",[65,199,200,210],{},[39,201,202,205,206,209],{},[20,203,204],{},"What"," operations can be performed → ",[20,207,208],{},"public"," (the client can see this).",[39,211,212,215,216,219,220,223],{},[20,213,214],{},"How"," those operations are implemented → ",[20,217,218],{},"private"," (hidden from the client).\nThe user of an ADT only interacts with its ",[20,221,222],{},"interface",", never its internal logic.",[57,225,227],{"id":226},"adt-vs-data-structure-whats-the-difference","ADT vs. Data Structure — what's the difference?",[11,229,230],{},"This is the question that trips up almost every beginner, so let's nail it down:",[232,233,234,256],"table",{},[235,236,237],"thead",{},[238,239,240,246,251],"tr",{},[241,242,243],"th",{},[244,245],"br",{},[241,247,248],{},[20,249,250],{},"ADT",[241,252,253],{},[20,254,255],{},"Data Structure",[257,258,259,273,290,303],"tbody",{},[238,260,261,267,270],{},[262,263,264],"td",{},[20,265,266],{},"Nature",[262,268,269],{},"Conceptual \u002F abstract",[262,271,272],{},"Concrete \u002F actual code",[238,274,275,280,285],{},[262,276,277],{},[20,278,279],{},"Focus",[262,281,282,284],{},[15,283,204],{}," it does",[262,286,287,289],{},[15,288,214],{}," it does it",[238,291,292,297,300],{},[262,293,294],{},[20,295,296],{},"Language?",[262,298,299],{},"Language-independent",[262,301,302],{},"Language-specific",[238,304,305,310,313],{},[262,306,307],{},[20,308,309],{},"Example",[262,311,312],{},"\"List ADT supports add\u002Fremove\u002Faccess\"",[262,314,315],{},"\"Use an array or linked list to implement it\"",[11,317,318],{},"A few classic ADTs you'll meet soon:",[65,320,321,327,340],{},[39,322,323,326],{},[20,324,325],{},"List ADT"," → supports adding, removing, and accessing elements.",[39,328,329,332,333,336,337,104],{},[20,330,331],{},"Stack ADT"," → Last-In-First-Out (LIFO). Think ",[151,334,335],{},"push"," and ",[151,338,339],{},"pop",[39,341,342,345,346,336,349,352,353,356,357,360],{},[20,343,344],{},"Queue ADT"," → First-In-First-Out (FIFO). Think ",[151,347,348],{},"enqueue",[151,350,351],{},"dequeue",".\nAll three of these could be implemented using either an ",[20,354,355],{},"array"," or a ",[20,358,359],{},"linked list"," — same ADT, different data structures.",[57,362,364],{"id":363},"an-adt-in-plain-english-a-cinema-reservation-system","An ADT in plain English: a cinema reservation system",[11,366,367],{},"Let's design an ADT for booking cinema seats — without writing a single line of code.",[65,369,370,383,402],{},[39,371,372,375,376,379,380,104],{},[20,373,374],{},"Data?"," Seats. Each seat is either ",[15,377,378],{},"reserved"," or ",[15,381,382],{},"available",[39,384,385,388],{},[20,386,387],{},"Operations?",[65,389,390,393,396,399],{},[39,391,392],{},"Check if a seat is available",[39,394,395],{},"Reserve a seat",[39,397,398],{},"Cancel a reservation",[39,400,401],{},"Find a block of available seats together",[39,403,404,407],{},[20,405,406],{},"Implementation?"," Don't care. Not now.\nThat's it — that's an ADT specification. Whether the seats end up stored in a 2D array, a database, or scribbled on paper is somebody else's problem.",[57,409,411],{"id":410},"a-common-thread-example-cards-contacts-and-decks","A common-thread example: cards, contacts, and decks",[11,413,414],{},"Consider these unrelated things:",[65,416,417,420,423,426,432,435,438,441],{},[39,418,419],{},"A deck of playing cards",[39,421,422],{},"A box of index cards with birthdays",[39,424,425],{},"The contacts list on your phone. They all share the same underlying behavior:",[39,427,428,429,104],{},"Each is a ",[20,430,431],{},"collection of elements",[39,433,434],{},"There's a first element, a second, ..., a last.",[39,436,437],{},"Given any element, there's a \"next\" one (unless it's the last).",[39,439,440],{},"Given any element, there's a \"previous\" one (unless it's the first).",[39,442,443,444,447,448,451,452,455,456,458],{},"You can ",[20,445,446],{},"add"," an element, ",[20,449,450],{},"remove"," one, and ",[20,453,454],{},"search"," for one by going through systematically.\nThis shared structure is what would later be called the ",[20,457,325],{},". Once you spot the pattern, the same ADT covers all three.",[57,460,462],{"id":461},"why-bother-with-adts-at-all","Why bother with ADTs at all?",[11,464,465],{},"Two big wins:",[36,467,468,474],{},[39,469,470,473],{},[20,471,472],{},"Shared data and operations"," — design once, reuse everywhere. The same Bag ADT works for a shopping cart and a piggy bank.",[39,475,476,479,480,482],{},[20,477,478],{},"Information hiding"," — users of the ADT don't need to know ",[15,481,26],{}," it's implemented. The implementer can swap an array for a linked list, optimize for speed, fix bugs — and as long as the interface stays the same, no client code breaks.\nThis is the heart of good software design. Hold onto it.",[52,484,486],{"id":485},"part-2-the-bag","Part 2: The Bag",[11,488,489,490,104],{},"Now let's see all of this in action with a really simple ADT: the ",[20,491,492],{},"Bag",[57,494,496],{"id":495},"whats-a-bag","What's a bag?",[11,498,499],{},"Picture a real bag — a backpack, a tote, a grocery bag. Now ask yourself:",[65,501,502,512,521],{},[39,503,504,507,508,511],{},[15,505,506],{},"Should the items be stored in a specific order?"," → ",[20,509,510],{},"No",", you just toss stuff in.",[39,513,514,507,517,520],{},[15,515,516],{},"Can you keep repetitive items in the same bag?",[20,518,519],{},"Yes",", two apples are fine.",[39,522,523,526],{},[15,524,525],{},"Is there a standard size limit?"," → It varies. Some bags are fixed, some stretch.\nSo a \"bag\" in programming has the same vibe:",[140,528,529],{},[11,530,531],{},[20,532,533],{},"The ADT Bag is a finite collection of objects in no particular order, possibly with duplicates.",[11,535,536],{},"That's the whole definition. No sorting, no positions, no uniqueness — just stuff in a bag.",[57,538,540],{"id":539},"what-can-you-do-with-a-bag","What can you do with a bag?",[11,542,543],{},"The standard behaviors are:",[65,545,546,552,558,565,571,577,584,590],{},[39,547,548,551],{},[20,549,550],{},"Add"," an object to the bag.",[39,553,554,557],{},[20,555,556],{},"Remove"," an object from the bag.",[39,559,560,561,564],{},"Get the ",[20,562,563],{},"number of items"," inside.",[39,566,567,568,104],{},"Check if the bag is ",[20,569,570],{},"empty",[39,572,573,574,104],{},"Count how often a specific object ",[20,575,576],{},"appears",[39,578,579,580,583],{},"Check whether the bag ",[20,581,582],{},"contains"," a specific object.",[39,585,586,589],{},[20,587,588],{},"Clear"," the bag.",[39,591,592,593,596],{},"Get ",[20,594,595],{},"all items"," as an array.",[57,598,600],{"id":599},"designing-the-bag-with-a-crc-card","Designing the bag with a CRC card",[11,602,603,604,607,608,611],{},"Before writing code, designers often use a ",[20,605,606],{},"CRC card"," — short for ",[20,609,610],{},"Class–Responsibility–Collaboration",". It's a sticky-note-sized summary of one class:",[613,614,619],"pre",{"className":615,"code":617,"language":618},[616],"language-text","┌──────────────────────────────────────────────────────────┐\n│                          Bag                             │\n├──────────────────────────────────────────────────────────┤\n│ Responsibilities:                                        │\n│   - Get the number of items currently in the bag         │\n│   - See whether the bag is empty                         │\n│   - Add a given object to the bag                        │\n│   - Remove an unspecified object from the bag            │\n│   - Remove an occurrence of a particular object          │\n│   - Remove all objects from the bag                      │\n│   - Count how many times an object occurs in the bag     │\n│   - Test whether the bag contains a particular object    │\n│   - Look at all objects that are in the bag              │\n├──────────────────────────────────────────────────────────┤\n│ Collaborations:                                          │\n│   - The class of objects that the bag can contain        │\n└──────────────────────────────────────────────────────────┘\n","text",[151,620,617],{"__ignoreMap":621},"",[11,623,624,625,336,628,104],{},"Notice we're still not writing any code. We're just listing ",[20,626,627],{},"what the class is responsible for",[20,629,630],{},"who it works with",[57,632,634],{"id":633},"uml-notation-the-same-idea-more-formal","UML notation — the same idea, more formal",[11,636,637,638,641],{},"Once we have the CRC card, the next step is to specify each method precisely — its name, parameters, and return type. ",[20,639,640],{},"UML"," (Unified Modeling Language) gives us a clean diagram for this:",[613,643,646],{"className":644,"code":645,"language":618},[616],"┌────────────────────────────────────────┐\n│                  Bag                   │\n├────────────────────────────────────────┤\n│                                        │\n├────────────────────────────────────────┤\n│ +getCurrentSize(): integer             │\n│ +isEmpty(): boolean                    │\n│ +add(newEntry: T): boolean             │\n│ +remove(): T                           │\n│ +remove(anEntry: T): boolean           │\n│ +clear(): void                         │\n│ +getFrequencyOf(anEntry: T): integer   │\n│ +contains(anEntry: T): boolean         │\n│ +toArray(): T[]                        │\n└────────────────────────────────────────┘\n",[151,647,645],{"__ignoreMap":621},[11,649,650,651,654,655,657,658,661],{},"The ",[151,652,653],{},"+"," means ",[15,656,208],{},". The ",[151,659,660],{},"T"," is a generic type — the bag can hold any kind of object.",[11,663,664],{},"Here's what each method does:",[232,666,667,677],{},[235,668,669],{},[238,670,671,674],{},[241,672,673],{},"Method",[241,675,676],{},"Purpose",[257,678,679,689,702,715,732,745,755,765,777],{},[238,680,681,686],{},[262,682,683],{},[151,684,685],{},"getCurrentSize()",[262,687,688],{},"How many objects are in the bag right now.",[238,690,691,696],{},[262,692,693],{},[151,694,695],{},"isEmpty()",[262,697,698,701],{},[151,699,700],{},"true"," if the bag has nothing in it.",[238,703,704,709],{},[262,705,706],{},[151,707,708],{},"add(newEntry)",[262,710,711,712,714],{},"Add an object. Returns ",[151,713,700],{}," on success.",[238,716,717,722],{},[262,718,719],{},[151,720,721],{},"remove()",[262,723,724,725,728,729,104],{},"Remove ",[15,726,727],{},"some"," (unspecified) object. Returns it, or ",[151,730,731],{},"null",[238,733,734,739],{},[262,735,736],{},[151,737,738],{},"remove(anEntry)",[262,740,741,742,744],{},"Remove one occurrence of a specific object. Returns ",[151,743,700],{}," if found and removed.",[238,746,747,752],{},[262,748,749],{},[151,750,751],{},"clear()",[262,753,754],{},"Empty the bag.",[238,756,757,762],{},[262,758,759],{},[151,760,761],{},"getFrequencyOf(anEntry)",[262,763,764],{},"How many times this object appears.",[238,766,767,772],{},[262,768,769],{},[151,770,771],{},"contains(anEntry)",[262,773,774,776],{},[151,775,700],{}," if the object is in the bag.",[238,778,779,784],{},[262,780,781],{},[151,782,783],{},"toArray()",[262,785,786],{},"Return all items as an array.",[57,788,790],{"id":789},"design-decisions-handling-weird-situations","Design decisions: handling weird situations",[11,792,793,794,796,797,800],{},"What if someone calls ",[151,795,721],{}," on an empty bag? What should happen? There's no single right answer — there are ",[15,798,799],{},"choices",":",[65,802,803,809,815,821,830,843],{},[39,804,805,808],{},[20,806,807],{},"Assume it won't happen"," (risky).",[39,810,811,814],{},[20,812,813],{},"Ignore invalid situations"," (silently do nothing).",[39,816,817,820],{},[20,818,819],{},"Guess the client's intention"," (also risky).",[39,822,823,826,827,829],{},[20,824,825],{},"Return a special value"," that signals a problem (like ",[151,828,731],{},").",[39,831,832,835,836,838,839,842],{},[20,833,834],{},"Return a boolean"," — ",[151,837,700],{}," for success, ",[151,840,841],{},"false"," for failure.",[39,844,845,848],{},[20,846,847],{},"Throw an exception"," — the most explicit, but interrupts flow.",[11,850,851,852,855,856,858,859,861,862,864,865,868],{},"Good ADT design means making these decisions ",[15,853,854],{},"deliberately"," and documenting them. The Bag we'll look at uses ",[151,857,731],{}," for ",[151,860,721],{}," on empty, and ",[151,863,841],{}," from ",[151,866,867],{},"add()"," if it fails.",[57,870,872],{"id":871},"from-specification-to-java-interface","From specification to Java interface",[11,874,875,876,879],{},"Once the methods are specified, we can write them as a ",[20,877,878],{},"Java interface"," — a contract that any Bag implementation must follow:",[613,881,885],{"className":882,"code":883,"language":884,"meta":621,"style":621},"language-java shiki shiki-themes github-light github-dark","\u002F**\n * An interface that describes the operations of a bag of objects.\n * @author Frank M. Carrano\n *\u002F\npublic interface BagInterface\u003CT> {\n    \u002F** Gets the current number of entries in this bag. *\u002F\n    public int getCurrentSize();\n \n    \u002F** Sees whether this bag is empty. *\u002F\n    public boolean isEmpty();\n \n    \u002F** Adds a new entry to this bag.\n     *  @return True if the addition is successful, false if not. *\u002F\n    public boolean add(T newEntry);\n \n    \u002F** Removes one unspecified entry from this bag, if possible.\n     *  @return Either the removed entry, if the removal was successful, or null. *\u002F\n    public T remove();\n \n    \u002F** Removes one occurrence of a given entry from this bag, if possible. *\u002F\n    public boolean remove(T anEntry);\n \n    \u002F** Removes all entries from this bag. *\u002F\n    public void clear();\n \n    \u002F** Counts the number of times a given entry appears in this bag. *\u002F\n    public int getFrequencyOf(T anEntry);\n \n    \u002F** Tests whether this bag contains a given entry. *\u002F\n    public boolean contains(T anEntry);\n \n    \u002F** Retrieves all entries that are in this bag.\n     *  @return A newly allocated array of all the entries in the bag. *\u002F\n    public T[] toArray();\n}\n","java",[151,886,887,896,902,915,921,942,948,963,969,975,988,993,999,1011,1031,1036,1042,1052,1064,1069,1075,1092,1097,1103,1116,1121,1127,1143,1148,1154,1170,1175,1181,1191,1207],{"__ignoreMap":621},[888,889,892],"span",{"class":890,"line":891},"line",1,[888,893,895],{"class":894},"sJ8bj","\u002F**\n",[888,897,899],{"class":890,"line":898},2,[888,900,901],{"class":894}," * An interface that describes the operations of a bag of objects.\n",[888,903,905,908,912],{"class":890,"line":904},3,[888,906,907],{"class":894}," * ",[888,909,911],{"class":910},"szBVR","@author",[888,913,914],{"class":894}," Frank M. Carrano\n",[888,916,918],{"class":890,"line":917},4,[888,919,920],{"class":894}," *\u002F\n",[888,922,924,926,929,933,937,939],{"class":890,"line":923},5,[888,925,208],{"class":910},[888,927,928],{"class":910}," interface",[888,930,932],{"class":931},"sScJk"," BagInterface",[888,934,936],{"class":935},"sVt8B","\u003C",[888,938,660],{"class":910},[888,940,941],{"class":935},"> {\n",[888,943,945],{"class":890,"line":944},6,[888,946,947],{"class":894},"    \u002F** Gets the current number of entries in this bag. *\u002F\n",[888,949,951,954,957,960],{"class":890,"line":950},7,[888,952,953],{"class":910},"    public",[888,955,956],{"class":910}," int",[888,958,959],{"class":931}," getCurrentSize",[888,961,962],{"class":935},"();\n",[888,964,966],{"class":890,"line":965},8,[888,967,968],{"class":935}," \n",[888,970,972],{"class":890,"line":971},9,[888,973,974],{"class":894},"    \u002F** Sees whether this bag is empty. *\u002F\n",[888,976,978,980,983,986],{"class":890,"line":977},10,[888,979,953],{"class":910},[888,981,982],{"class":910}," boolean",[888,984,985],{"class":931}," isEmpty",[888,987,962],{"class":935},[888,989,991],{"class":890,"line":990},11,[888,992,968],{"class":935},[888,994,996],{"class":890,"line":995},12,[888,997,998],{"class":894},"    \u002F** Adds a new entry to this bag.\n",[888,1000,1002,1005,1008],{"class":890,"line":1001},13,[888,1003,1004],{"class":894},"     *  ",[888,1006,1007],{"class":910},"@return",[888,1009,1010],{"class":894}," True if the addition is successful, false if not. *\u002F\n",[888,1012,1014,1016,1018,1021,1024,1028],{"class":890,"line":1013},14,[888,1015,953],{"class":910},[888,1017,982],{"class":910},[888,1019,1020],{"class":931}," add",[888,1022,1023],{"class":935},"(T ",[888,1025,1027],{"class":1026},"s4XuR","newEntry",[888,1029,1030],{"class":935},");\n",[888,1032,1034],{"class":890,"line":1033},15,[888,1035,968],{"class":935},[888,1037,1039],{"class":890,"line":1038},16,[888,1040,1041],{"class":894},"    \u002F** Removes one unspecified entry from this bag, if possible.\n",[888,1043,1045,1047,1049],{"class":890,"line":1044},17,[888,1046,1004],{"class":894},[888,1048,1007],{"class":910},[888,1050,1051],{"class":894}," Either the removed entry, if the removal was successful, or null. *\u002F\n",[888,1053,1055,1057,1060,1062],{"class":890,"line":1054},18,[888,1056,953],{"class":910},[888,1058,1059],{"class":935}," T ",[888,1061,450],{"class":931},[888,1063,962],{"class":935},[888,1065,1067],{"class":890,"line":1066},19,[888,1068,968],{"class":935},[888,1070,1072],{"class":890,"line":1071},20,[888,1073,1074],{"class":894},"    \u002F** Removes one occurrence of a given entry from this bag, if possible. *\u002F\n",[888,1076,1078,1080,1082,1085,1087,1090],{"class":890,"line":1077},21,[888,1079,953],{"class":910},[888,1081,982],{"class":910},[888,1083,1084],{"class":931}," remove",[888,1086,1023],{"class":935},[888,1088,1089],{"class":1026},"anEntry",[888,1091,1030],{"class":935},[888,1093,1095],{"class":890,"line":1094},22,[888,1096,968],{"class":935},[888,1098,1100],{"class":890,"line":1099},23,[888,1101,1102],{"class":894},"    \u002F** Removes all entries from this bag. *\u002F\n",[888,1104,1106,1108,1111,1114],{"class":890,"line":1105},24,[888,1107,953],{"class":910},[888,1109,1110],{"class":910}," void",[888,1112,1113],{"class":931}," clear",[888,1115,962],{"class":935},[888,1117,1119],{"class":890,"line":1118},25,[888,1120,968],{"class":935},[888,1122,1124],{"class":890,"line":1123},26,[888,1125,1126],{"class":894},"    \u002F** Counts the number of times a given entry appears in this bag. *\u002F\n",[888,1128,1130,1132,1134,1137,1139,1141],{"class":890,"line":1129},27,[888,1131,953],{"class":910},[888,1133,956],{"class":910},[888,1135,1136],{"class":931}," getFrequencyOf",[888,1138,1023],{"class":935},[888,1140,1089],{"class":1026},[888,1142,1030],{"class":935},[888,1144,1146],{"class":890,"line":1145},28,[888,1147,968],{"class":935},[888,1149,1151],{"class":890,"line":1150},29,[888,1152,1153],{"class":894},"    \u002F** Tests whether this bag contains a given entry. *\u002F\n",[888,1155,1157,1159,1161,1164,1166,1168],{"class":890,"line":1156},30,[888,1158,953],{"class":910},[888,1160,982],{"class":910},[888,1162,1163],{"class":931}," contains",[888,1165,1023],{"class":935},[888,1167,1089],{"class":1026},[888,1169,1030],{"class":935},[888,1171,1173],{"class":890,"line":1172},31,[888,1174,968],{"class":935},[888,1176,1178],{"class":890,"line":1177},32,[888,1179,1180],{"class":894},"    \u002F** Retrieves all entries that are in this bag.\n",[888,1182,1184,1186,1188],{"class":890,"line":1183},33,[888,1185,1004],{"class":894},[888,1187,1007],{"class":910},[888,1189,1190],{"class":894}," A newly allocated array of all the entries in the bag. *\u002F\n",[888,1192,1194,1196,1199,1202,1205],{"class":890,"line":1193},34,[888,1195,953],{"class":910},[888,1197,1198],{"class":910}," T",[888,1200,1201],{"class":935},"[] ",[888,1203,1204],{"class":931},"toArray",[888,1206,962],{"class":935},[888,1208,1210],{"class":890,"line":1209},35,[888,1211,1212],{"class":935},"}\n",[11,1214,1215,1216,1219],{},"This is ",[15,1217,1218],{},"still"," the ADT side. There's no actual storage logic yet — just a list of method signatures.",[57,1221,1223],{"id":1222},"implementing-the-adt-and-why-we-dont-care-how","Implementing the ADT — and why we don't care how",[11,1225,1226,1227,1229],{},"Now imagine we hand this interface to a programmer and ask: \"Build me a ",[151,1228,492],{}," class in Java that implements this.\"",[11,1231,1232,1233,1236,1237,1240],{},"They might use an array. They might use a linked list. They might use a hash table or some wild custom structure. ",[20,1234,1235],{},"It doesn't matter to us."," As long as the class implements ",[151,1238,1239],{},"BagInterface\u003CT>"," correctly, every method does what its specification says, and we can use it.",[11,1242,1243,1244],{},"This is the magic of ADTs in practice: ",[20,1245,1246],{},"you can change implementations without breaking client code.",[57,1248,1250],{"id":1249},"example-1-an-online-shopping-cart","Example 1: An online shopping cart",[11,1252,1253,1254,1256],{},"Here's a small program that uses ",[151,1255,492],{}," as a shopping cart:",[613,1258,1260],{"className":882,"code":1259,"language":884,"meta":621,"style":621},"public class OnlineShopper {\n    public static void main(String[] args) {\n        Item[] items = {\n            new Item(\"Bird feeder\", 2050),\n            new Item(\"Squirrel guard\", 1547),\n            new Item(\"Bird bath\", 4499),\n            new Item(\"Sunflower seeds\", 1295)\n        };\n \n        BagInterface\u003CItem> shoppingCart = new Bag\u003C>();\n        int totalCost = 0;\n \n        \u002F\u002F Add selected items to the cart\n        for (int index = 0; index \u003C items.length; index++) {\n            Item nextItem = items[index];\n            shoppingCart.add(nextItem);\n            totalCost = totalCost + nextItem.getPrice();\n        }\n \n        \u002F\u002F Simulate checkout\n        while (!shoppingCart.isEmpty())\n            System.out.println(shoppingCart.remove());\n \n        System.out.println(\"Total cost: \\t$\" + totalCost \u002F 100 + \".\" + totalCost % 100);\n    }\n}\n",[151,1261,1262,1275,1301,1314,1338,1356,1374,1393,1398,1402,1421,1437,1441,1446,1477,1487,1497,1516,1521,1525,1530,1549,1565,1569,1614,1619],{"__ignoreMap":621},[888,1263,1264,1266,1269,1272],{"class":890,"line":891},[888,1265,208],{"class":910},[888,1267,1268],{"class":910}," class",[888,1270,1271],{"class":931}," OnlineShopper",[888,1273,1274],{"class":935}," {\n",[888,1276,1277,1279,1282,1284,1287,1290,1293,1295,1298],{"class":890,"line":898},[888,1278,953],{"class":910},[888,1280,1281],{"class":910}," static",[888,1283,1110],{"class":910},[888,1285,1286],{"class":931}," main",[888,1288,1289],{"class":935},"(",[888,1291,1292],{"class":910},"String",[888,1294,1201],{"class":935},[888,1296,1297],{"class":1026},"args",[888,1299,1300],{"class":935},") {\n",[888,1302,1303,1306,1309,1312],{"class":890,"line":904},[888,1304,1305],{"class":910},"        Item",[888,1307,1308],{"class":935},"[] items ",[888,1310,1311],{"class":910},"=",[888,1313,1274],{"class":935},[888,1315,1316,1319,1322,1324,1328,1331,1335],{"class":890,"line":917},[888,1317,1318],{"class":910},"            new",[888,1320,1321],{"class":931}," Item",[888,1323,1289],{"class":935},[888,1325,1327],{"class":1326},"sZZnC","\"Bird feeder\"",[888,1329,1330],{"class":935},", ",[888,1332,1334],{"class":1333},"sj4cs","2050",[888,1336,1337],{"class":935},"),\n",[888,1339,1340,1342,1344,1346,1349,1351,1354],{"class":890,"line":923},[888,1341,1318],{"class":910},[888,1343,1321],{"class":931},[888,1345,1289],{"class":935},[888,1347,1348],{"class":1326},"\"Squirrel guard\"",[888,1350,1330],{"class":935},[888,1352,1353],{"class":1333},"1547",[888,1355,1337],{"class":935},[888,1357,1358,1360,1362,1364,1367,1369,1372],{"class":890,"line":944},[888,1359,1318],{"class":910},[888,1361,1321],{"class":931},[888,1363,1289],{"class":935},[888,1365,1366],{"class":1326},"\"Bird bath\"",[888,1368,1330],{"class":935},[888,1370,1371],{"class":1333},"4499",[888,1373,1337],{"class":935},[888,1375,1376,1378,1380,1382,1385,1387,1390],{"class":890,"line":950},[888,1377,1318],{"class":910},[888,1379,1321],{"class":931},[888,1381,1289],{"class":935},[888,1383,1384],{"class":1326},"\"Sunflower seeds\"",[888,1386,1330],{"class":935},[888,1388,1389],{"class":1333},"1295",[888,1391,1392],{"class":935},")\n",[888,1394,1395],{"class":890,"line":965},[888,1396,1397],{"class":935},"        };\n",[888,1399,1400],{"class":890,"line":971},[888,1401,968],{"class":935},[888,1403,1404,1407,1410,1413,1415,1418],{"class":890,"line":977},[888,1405,1406],{"class":935},"        BagInterface\u003C",[888,1408,1409],{"class":910},"Item",[888,1411,1412],{"class":935},"> shoppingCart ",[888,1414,1311],{"class":910},[888,1416,1417],{"class":910}," new",[888,1419,1420],{"class":935}," Bag\u003C>();\n",[888,1422,1423,1426,1429,1431,1434],{"class":890,"line":990},[888,1424,1425],{"class":910},"        int",[888,1427,1428],{"class":935}," totalCost ",[888,1430,1311],{"class":910},[888,1432,1433],{"class":1333}," 0",[888,1435,1436],{"class":935},";\n",[888,1438,1439],{"class":890,"line":995},[888,1440,968],{"class":935},[888,1442,1443],{"class":890,"line":1001},[888,1444,1445],{"class":894},"        \u002F\u002F Add selected items to the cart\n",[888,1447,1448,1451,1454,1457,1460,1462,1464,1467,1469,1472,1475],{"class":890,"line":1013},[888,1449,1450],{"class":910},"        for",[888,1452,1453],{"class":935}," (",[888,1455,1456],{"class":910},"int",[888,1458,1459],{"class":935}," index ",[888,1461,1311],{"class":910},[888,1463,1433],{"class":1333},[888,1465,1466],{"class":935},"; index ",[888,1468,936],{"class":910},[888,1470,1471],{"class":935}," items.length; index",[888,1473,1474],{"class":910},"++",[888,1476,1300],{"class":935},[888,1478,1479,1482,1484],{"class":890,"line":1033},[888,1480,1481],{"class":935},"            Item nextItem ",[888,1483,1311],{"class":910},[888,1485,1486],{"class":935}," items[index];\n",[888,1488,1489,1492,1494],{"class":890,"line":1038},[888,1490,1491],{"class":935},"            shoppingCart.",[888,1493,446],{"class":931},[888,1495,1496],{"class":935},"(nextItem);\n",[888,1498,1499,1502,1504,1506,1508,1511,1514],{"class":890,"line":1044},[888,1500,1501],{"class":935},"            totalCost ",[888,1503,1311],{"class":910},[888,1505,1428],{"class":935},[888,1507,653],{"class":910},[888,1509,1510],{"class":935}," nextItem.",[888,1512,1513],{"class":931},"getPrice",[888,1515,962],{"class":935},[888,1517,1518],{"class":890,"line":1054},[888,1519,1520],{"class":935},"        }\n",[888,1522,1523],{"class":890,"line":1066},[888,1524,968],{"class":935},[888,1526,1527],{"class":890,"line":1071},[888,1528,1529],{"class":894},"        \u002F\u002F Simulate checkout\n",[888,1531,1532,1535,1537,1540,1543,1546],{"class":890,"line":1077},[888,1533,1534],{"class":910},"        while",[888,1536,1453],{"class":935},[888,1538,1539],{"class":910},"!",[888,1541,1542],{"class":935},"shoppingCart.",[888,1544,1545],{"class":931},"isEmpty",[888,1547,1548],{"class":935},"())\n",[888,1550,1551,1554,1557,1560,1562],{"class":890,"line":1094},[888,1552,1553],{"class":935},"            System.out.",[888,1555,1556],{"class":931},"println",[888,1558,1559],{"class":935},"(shoppingCart.",[888,1561,450],{"class":931},[888,1563,1564],{"class":935},"());\n",[888,1566,1567],{"class":890,"line":1099},[888,1568,968],{"class":935},[888,1570,1571,1574,1576,1578,1581,1584,1587,1590,1592,1595,1598,1600,1603,1605,1607,1610,1612],{"class":890,"line":1105},[888,1572,1573],{"class":935},"        System.out.",[888,1575,1556],{"class":931},[888,1577,1289],{"class":935},[888,1579,1580],{"class":1326},"\"Total cost: ",[888,1582,1583],{"class":1333},"\\t",[888,1585,1586],{"class":1326},"$\"",[888,1588,1589],{"class":910}," +",[888,1591,1428],{"class":935},[888,1593,1594],{"class":910},"\u002F",[888,1596,1597],{"class":1333}," 100",[888,1599,1589],{"class":910},[888,1601,1602],{"class":1326}," \".\"",[888,1604,1589],{"class":910},[888,1606,1428],{"class":935},[888,1608,1609],{"class":910},"%",[888,1611,1597],{"class":1333},[888,1613,1030],{"class":935},[888,1615,1616],{"class":890,"line":1118},[888,1617,1618],{"class":935},"    }\n",[888,1620,1621],{"class":890,"line":1123},[888,1622,1212],{"class":935},[11,1624,1625],{},"Sample output:",[613,1627,1630],{"className":1628,"code":1629,"language":618},[616],"Sunflower seeds $12.95\nBird bath       $44.99\nSquirrel guard  $15.47\nBird feeder     $20.50\nTotal cost:     $93.91\n",[151,1631,1629],{"__ignoreMap":621},[11,1633,1634,1635,1638],{},"Notice the items come out in a different order than they went in. ",[20,1636,1637],{},"That's fine"," — a Bag has no specified order. The shopping cart still works.",[57,1640,1642],{"id":1641},"example-2-a-piggy-bank","Example 2: A piggy bank",[613,1644,1646],{"className":882,"code":1645,"language":884,"meta":621,"style":621},"public class PiggyBank {\n    private BagInterface\u003CCoin> coins;\n \n    public PiggyBank() {\n        coins = new Bag\u003C>();\n    }\n \n    public boolean add(Coin aCoin) {\n        return coins.add(aCoin);\n    }\n \n    public Coin remove() {\n        return coins.remove();\n    }\n \n    public boolean isEmpty() {\n        return coins.isEmpty();\n    }\n}\n",[151,1647,1648,1659,1673,1677,1686,1697,1701,1705,1721,1734,1738,1742,1753,1763,1767,1771,1781,1791,1795],{"__ignoreMap":621},[888,1649,1650,1652,1654,1657],{"class":890,"line":891},[888,1651,208],{"class":910},[888,1653,1268],{"class":910},[888,1655,1656],{"class":931}," PiggyBank",[888,1658,1274],{"class":935},[888,1660,1661,1664,1667,1670],{"class":890,"line":898},[888,1662,1663],{"class":910},"    private",[888,1665,1666],{"class":935}," BagInterface\u003C",[888,1668,1669],{"class":910},"Coin",[888,1671,1672],{"class":935},"> coins;\n",[888,1674,1675],{"class":890,"line":904},[888,1676,968],{"class":935},[888,1678,1679,1681,1683],{"class":890,"line":917},[888,1680,953],{"class":910},[888,1682,1656],{"class":931},[888,1684,1685],{"class":935},"() {\n",[888,1687,1688,1691,1693,1695],{"class":890,"line":923},[888,1689,1690],{"class":935},"        coins ",[888,1692,1311],{"class":910},[888,1694,1417],{"class":910},[888,1696,1420],{"class":935},[888,1698,1699],{"class":890,"line":944},[888,1700,1618],{"class":935},[888,1702,1703],{"class":890,"line":950},[888,1704,968],{"class":935},[888,1706,1707,1709,1711,1713,1716,1719],{"class":890,"line":965},[888,1708,953],{"class":910},[888,1710,982],{"class":910},[888,1712,1020],{"class":931},[888,1714,1715],{"class":935},"(Coin ",[888,1717,1718],{"class":1026},"aCoin",[888,1720,1300],{"class":935},[888,1722,1723,1726,1729,1731],{"class":890,"line":971},[888,1724,1725],{"class":910},"        return",[888,1727,1728],{"class":935}," coins.",[888,1730,446],{"class":931},[888,1732,1733],{"class":935},"(aCoin);\n",[888,1735,1736],{"class":890,"line":977},[888,1737,1618],{"class":935},[888,1739,1740],{"class":890,"line":990},[888,1741,968],{"class":935},[888,1743,1744,1746,1749,1751],{"class":890,"line":995},[888,1745,953],{"class":910},[888,1747,1748],{"class":935}," Coin ",[888,1750,450],{"class":931},[888,1752,1685],{"class":935},[888,1754,1755,1757,1759,1761],{"class":890,"line":1001},[888,1756,1725],{"class":910},[888,1758,1728],{"class":935},[888,1760,450],{"class":931},[888,1762,962],{"class":935},[888,1764,1765],{"class":890,"line":1013},[888,1766,1618],{"class":935},[888,1768,1769],{"class":890,"line":1033},[888,1770,968],{"class":935},[888,1772,1773,1775,1777,1779],{"class":890,"line":1038},[888,1774,953],{"class":910},[888,1776,982],{"class":910},[888,1778,985],{"class":931},[888,1780,1685],{"class":935},[888,1782,1783,1785,1787,1789],{"class":890,"line":1044},[888,1784,1725],{"class":910},[888,1786,1728],{"class":935},[888,1788,1545],{"class":931},[888,1790,962],{"class":935},[888,1792,1793],{"class":890,"line":1054},[888,1794,1618],{"class":935},[888,1796,1797],{"class":890,"line":1066},[888,1798,1212],{"class":935},[11,1800,1801],{},"And a quick demo:",[613,1803,1805],{"className":882,"code":1804,"language":884,"meta":621,"style":621},"PiggyBank myBank = new PiggyBank();\naddCoin(new Coin(1, 2010), myBank);   \u002F\u002F penny\naddCoin(new Coin(5, 2011), myBank);   \u002F\u002F nickel\naddCoin(new Coin(10, 2000), myBank);  \u002F\u002F dime\naddCoin(new Coin(25, 2012), myBank);  \u002F\u002F quarter\n \nSystem.out.println(\"Removing all the coins:\");\nint amountRemoved = 0;\nwhile (!myBank.isEmpty()) {\n    Coin removedCoin = myBank.remove();\n    System.out.println(\"Removed a \" + removedCoin.getCoinName() + \".\");\n    amountRemoved = amountRemoved + removedCoin.getValue();\n}\nSystem.out.println(\"All done. Removed \" + amountRemoved + \" cents.\");\n",[151,1806,1807,1820,1849,1874,1900,1925,1929,1943,1956,1973,1987,2016,2034,2038],{"__ignoreMap":621},[888,1808,1809,1812,1814,1816,1818],{"class":890,"line":891},[888,1810,1811],{"class":935},"PiggyBank myBank ",[888,1813,1311],{"class":910},[888,1815,1417],{"class":910},[888,1817,1656],{"class":931},[888,1819,962],{"class":935},[888,1821,1822,1825,1827,1830,1833,1835,1838,1840,1843,1846],{"class":890,"line":898},[888,1823,1824],{"class":931},"addCoin",[888,1826,1289],{"class":935},[888,1828,1829],{"class":910},"new",[888,1831,1832],{"class":931}," Coin",[888,1834,1289],{"class":935},[888,1836,1837],{"class":1333},"1",[888,1839,1330],{"class":935},[888,1841,1842],{"class":1333},"2010",[888,1844,1845],{"class":935},"), myBank);   ",[888,1847,1848],{"class":894},"\u002F\u002F penny\n",[888,1850,1851,1853,1855,1857,1859,1861,1864,1866,1869,1871],{"class":890,"line":904},[888,1852,1824],{"class":931},[888,1854,1289],{"class":935},[888,1856,1829],{"class":910},[888,1858,1832],{"class":931},[888,1860,1289],{"class":935},[888,1862,1863],{"class":1333},"5",[888,1865,1330],{"class":935},[888,1867,1868],{"class":1333},"2011",[888,1870,1845],{"class":935},[888,1872,1873],{"class":894},"\u002F\u002F nickel\n",[888,1875,1876,1878,1880,1882,1884,1886,1889,1891,1894,1897],{"class":890,"line":917},[888,1877,1824],{"class":931},[888,1879,1289],{"class":935},[888,1881,1829],{"class":910},[888,1883,1832],{"class":931},[888,1885,1289],{"class":935},[888,1887,1888],{"class":1333},"10",[888,1890,1330],{"class":935},[888,1892,1893],{"class":1333},"2000",[888,1895,1896],{"class":935},"), myBank);  ",[888,1898,1899],{"class":894},"\u002F\u002F dime\n",[888,1901,1902,1904,1906,1908,1910,1912,1915,1917,1920,1922],{"class":890,"line":923},[888,1903,1824],{"class":931},[888,1905,1289],{"class":935},[888,1907,1829],{"class":910},[888,1909,1832],{"class":931},[888,1911,1289],{"class":935},[888,1913,1914],{"class":1333},"25",[888,1916,1330],{"class":935},[888,1918,1919],{"class":1333},"2012",[888,1921,1896],{"class":935},[888,1923,1924],{"class":894},"\u002F\u002F quarter\n",[888,1926,1927],{"class":890,"line":944},[888,1928,968],{"class":935},[888,1930,1931,1934,1936,1938,1941],{"class":890,"line":950},[888,1932,1933],{"class":935},"System.out.",[888,1935,1556],{"class":931},[888,1937,1289],{"class":935},[888,1939,1940],{"class":1326},"\"Removing all the coins:\"",[888,1942,1030],{"class":935},[888,1944,1945,1947,1950,1952,1954],{"class":890,"line":965},[888,1946,1456],{"class":910},[888,1948,1949],{"class":935}," amountRemoved ",[888,1951,1311],{"class":910},[888,1953,1433],{"class":1333},[888,1955,1436],{"class":935},[888,1957,1958,1961,1963,1965,1968,1970],{"class":890,"line":971},[888,1959,1960],{"class":910},"while",[888,1962,1453],{"class":935},[888,1964,1539],{"class":910},[888,1966,1967],{"class":935},"myBank.",[888,1969,1545],{"class":931},[888,1971,1972],{"class":935},"()) {\n",[888,1974,1975,1978,1980,1983,1985],{"class":890,"line":977},[888,1976,1977],{"class":935},"    Coin removedCoin ",[888,1979,1311],{"class":910},[888,1981,1982],{"class":935}," myBank.",[888,1984,450],{"class":931},[888,1986,962],{"class":935},[888,1988,1989,1992,1994,1996,1999,2001,2004,2007,2010,2012,2014],{"class":890,"line":990},[888,1990,1991],{"class":935},"    System.out.",[888,1993,1556],{"class":931},[888,1995,1289],{"class":935},[888,1997,1998],{"class":1326},"\"Removed a \"",[888,2000,1589],{"class":910},[888,2002,2003],{"class":935}," removedCoin.",[888,2005,2006],{"class":931},"getCoinName",[888,2008,2009],{"class":935},"() ",[888,2011,653],{"class":910},[888,2013,1602],{"class":1326},[888,2015,1030],{"class":935},[888,2017,2018,2021,2023,2025,2027,2029,2032],{"class":890,"line":995},[888,2019,2020],{"class":935},"    amountRemoved ",[888,2022,1311],{"class":910},[888,2024,1949],{"class":935},[888,2026,653],{"class":910},[888,2028,2003],{"class":935},[888,2030,2031],{"class":931},"getValue",[888,2033,962],{"class":935},[888,2035,2036],{"class":890,"line":1001},[888,2037,1212],{"class":935},[888,2039,2040,2042,2044,2046,2049,2051,2053,2055,2058],{"class":890,"line":1013},[888,2041,1933],{"class":935},[888,2043,1556],{"class":931},[888,2045,1289],{"class":935},[888,2047,2048],{"class":1326},"\"All done. Removed \"",[888,2050,1589],{"class":910},[888,2052,1949],{"class":935},[888,2054,653],{"class":910},[888,2056,2057],{"class":1326}," \" cents.\"",[888,2059,1030],{"class":935},[11,2061,2062],{},"Output:",[613,2064,2067],{"className":2065,"code":2066,"language":618},[616],"Added a PENNY.\nAdded a NICKEL.\nAdded a DIME.\nAdded a QUARTER.\nRemoving all the coins:\nRemoved a QUARTER.\nRemoved a DIME.\nRemoved a NICKEL.\nRemoved a PENNY.\nAll done. Removed 41 cents.\n",[151,2068,2066],{"__ignoreMap":621},[11,2070,2071,2072,336,2075,2078,2079,2081,2082],{},"Both ",[151,2073,2074],{},"OnlineShopper",[151,2076,2077],{},"PiggyBank"," use the same ",[151,2080,492],{}," class with totally different domains. ",[20,2083,2084],{},"One ADT, many uses.",[57,2086,2088],{"id":2087},"the-vending-machine-analogy","The vending machine analogy",[11,2090,2091,2092],{},"Here's the mental model I always come back to: ",[20,2093,2094],{},"using an ADT is like using a vending machine.",[232,2096,2097,2107],{},[235,2098,2099],{},[238,2100,2101,2104],{},[241,2102,2103],{},"Vending Machine",[241,2105,2106],{},"ADT Bag",[257,2108,2109,2117,2125,2133,2141],{},[238,2110,2111,2114],{},[262,2112,2113],{},"You can only do what the buttons let you do.",[262,2115,2116],{},"You can only call the methods the ADT exposes.",[238,2118,2119,2122],{},[262,2120,2121],{},"You must understand what each button does.",[262,2123,2124],{},"You must follow the method specifications.",[238,2126,2127,2130],{},[262,2128,2129],{},"You can't open the machine and rearrange things.",[262,2131,2132],{},"You can't poke at the internal data directly.",[238,2134,2135,2138],{},[262,2136,2137],{},"You can use it without knowing what's inside.",[262,2139,2140],{},"You can use it without knowing how it stores data.",[238,2142,2143,2146],{},[262,2144,2145],{},"Still works even if they restock or rewire it.",[262,2147,2148],{},"Still works if the implementation changes.",[11,2150,2151],{},"That's it. That's the whole philosophy.",[57,2153,2155,2156,2159],{"id":2154},"a-peek-ahead-how-javas-set-interface-looks","A peek ahead: how Java's ",[151,2157,2158],{},"Set"," interface looks",[11,2161,2162,2163,2165],{},"Just for context, Java's own ",[151,2164,2158],{}," interface is structured almost identically:",[613,2167,2169],{"className":882,"code":2168,"language":884,"meta":621,"style":621},"public interface SetInterface\u003CT> {\n    public int getCurrentSize();\n    public boolean isEmpty();\n    public boolean add(T newEntry);     \u002F\u002F avoids duplicates\n    public boolean remove(T anEntry);\n    public T remove();\n    public void clear();\n    public boolean contains(T anEntry);\n    public T[] toArray();\n}\n",[151,2170,2171,2186,2196,2206,2224,2238,2248,2258,2272,2284],{"__ignoreMap":621},[888,2172,2173,2175,2177,2180,2182,2184],{"class":890,"line":891},[888,2174,208],{"class":910},[888,2176,928],{"class":910},[888,2178,2179],{"class":931}," SetInterface",[888,2181,936],{"class":935},[888,2183,660],{"class":910},[888,2185,941],{"class":935},[888,2187,2188,2190,2192,2194],{"class":890,"line":898},[888,2189,953],{"class":910},[888,2191,956],{"class":910},[888,2193,959],{"class":931},[888,2195,962],{"class":935},[888,2197,2198,2200,2202,2204],{"class":890,"line":904},[888,2199,953],{"class":910},[888,2201,982],{"class":910},[888,2203,985],{"class":931},[888,2205,962],{"class":935},[888,2207,2208,2210,2212,2214,2216,2218,2221],{"class":890,"line":917},[888,2209,953],{"class":910},[888,2211,982],{"class":910},[888,2213,1020],{"class":931},[888,2215,1023],{"class":935},[888,2217,1027],{"class":1026},[888,2219,2220],{"class":935},");     ",[888,2222,2223],{"class":894},"\u002F\u002F avoids duplicates\n",[888,2225,2226,2228,2230,2232,2234,2236],{"class":890,"line":923},[888,2227,953],{"class":910},[888,2229,982],{"class":910},[888,2231,1084],{"class":931},[888,2233,1023],{"class":935},[888,2235,1089],{"class":1026},[888,2237,1030],{"class":935},[888,2239,2240,2242,2244,2246],{"class":890,"line":944},[888,2241,953],{"class":910},[888,2243,1059],{"class":935},[888,2245,450],{"class":931},[888,2247,962],{"class":935},[888,2249,2250,2252,2254,2256],{"class":890,"line":950},[888,2251,953],{"class":910},[888,2253,1110],{"class":910},[888,2255,1113],{"class":931},[888,2257,962],{"class":935},[888,2259,2260,2262,2264,2266,2268,2270],{"class":890,"line":965},[888,2261,953],{"class":910},[888,2263,982],{"class":910},[888,2265,1163],{"class":931},[888,2267,1023],{"class":935},[888,2269,1089],{"class":1026},[888,2271,1030],{"class":935},[888,2273,2274,2276,2278,2280,2282],{"class":890,"line":971},[888,2275,953],{"class":910},[888,2277,1198],{"class":910},[888,2279,1201],{"class":935},[888,2281,1204],{"class":931},[888,2283,962],{"class":935},[888,2285,2286],{"class":890,"line":977},[888,2287,1212],{"class":935},[11,2289,2290,2291,2294],{},"The big difference: ",[20,2292,2293],{},"a Set doesn't allow duplicates",". The Bag does. Same shape, different rules.",[57,2296,2298],{"id":2297},"looking-ahead-arraybag-and-linkedbag","Looking ahead: ArrayBag and LinkedBag",[11,2300,2301],{},"Now that the ADT is fully specified, we can implement it two different ways — and this is what the next part of the course covers:",[65,2303,2304,2318],{},[39,2305,2306,2311,2312],{},[20,2307,2308],{},[151,2309,2310],{},"ArrayBag"," — stores entries in a fixed-size array. Simple, fast access, but capacity is bounded.",[613,2313,2316],{"className":2314,"code":2315,"language":618},[616],"┌───────────────────────────┐\n│         ArrayBag          │\n├───────────────────────────┤\n│ -bag: T[]                 │\n│ -numberOfEntries: integer │\n│ -DEFAULT_CAPACITY: integer│\n├───────────────────────────┤\n│ (all the BagInterface     │\n│  methods, plus...)        │\n│ -isArrayFull(): boolean   │\n└───────────────────────────┘\n",[151,2317,2315],{"__ignoreMap":621},[39,2319,2320,2325,2326],{},[20,2321,2322],{},[151,2323,2324],{},"LinkedBag"," — stores entries in a chain of linked nodes. No size limit, but slightly more overhead per item.",[613,2327,2329],{"className":882,"code":2328,"language":884,"meta":621,"style":621},"public final class LinkedBag\u003CT> implements BagInterface\u003CT> {\n    private Node firstNode;\n    private int numberOfEntries;\n    \u002F\u002F ...\n    private class Node { \u002F* inner class *\u002F }\n}\n",[151,2330,2331,2361,2368,2377,2382,2400],{"__ignoreMap":621},[888,2332,2333,2335,2338,2340,2343,2345,2347,2350,2353,2355,2357,2359],{"class":890,"line":891},[888,2334,208],{"class":910},[888,2336,2337],{"class":910}," final",[888,2339,1268],{"class":910},[888,2341,2342],{"class":931}," LinkedBag",[888,2344,936],{"class":935},[888,2346,660],{"class":910},[888,2348,2349],{"class":935},"> ",[888,2351,2352],{"class":910},"implements",[888,2354,932],{"class":931},[888,2356,936],{"class":935},[888,2358,660],{"class":910},[888,2360,941],{"class":935},[888,2362,2363,2365],{"class":890,"line":898},[888,2364,1663],{"class":910},[888,2366,2367],{"class":935}," Node firstNode;\n",[888,2369,2370,2372,2374],{"class":890,"line":904},[888,2371,1663],{"class":910},[888,2373,956],{"class":910},[888,2375,2376],{"class":935}," numberOfEntries;\n",[888,2378,2379],{"class":890,"line":917},[888,2380,2381],{"class":894},"    \u002F\u002F ...\n",[888,2383,2384,2386,2388,2391,2394,2397],{"class":890,"line":923},[888,2385,1663],{"class":910},[888,2387,1268],{"class":910},[888,2389,2390],{"class":931}," Node",[888,2392,2393],{"class":935}," { ",[888,2395,2396],{"class":894},"\u002F* inner class *\u002F",[888,2398,2399],{"class":935}," }\n",[888,2401,2402],{"class":890,"line":944},[888,2403,1212],{"class":935},[11,2405,2406,2407,2409,2410,2413,2414,2417],{},"Both implement ",[151,2408,1239],{},". Both are valid bags. The choice between them is an ",[20,2411,2412],{},"implementation decision"," — and the rest of the client code doesn't care which one you use. ",[15,2415,2416],{},"That's"," the power of an ADT.",[52,2419,2421],{"id":2420},"quick-recap","Quick recap",[11,2423,2424],{},"If you remember just five things from this post:",[36,2426,2427,2438,2444,2449,2454],{},[39,2428,158,2429,2431,2432,2434,2435,2437],{},[20,2430,250],{}," is ",[15,2433,22],{}," a data type does, not ",[15,2436,26],{}," it does it.",[39,2439,69,2440,2443],{},[20,2441,2442],{},"data structure"," is the actual implementation of an ADT in code.",[39,2445,2446,2448],{},[20,2447,478],{}," lets the implementation change without breaking users.",[39,2450,69,2451,2453],{},[20,2452,492],{}," is a finite, unordered collection that allows duplicates.",[39,2455,2456],{},"The same Bag ADT can power a shopping cart, a piggy bank, or anything else — that's the whole point.",[2458,2459,2460],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}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 .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}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 .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":621,"searchDepth":898,"depth":898,"links":2462},[2463,2472,2487],{"id":54,"depth":898,"text":55,"children":2464},[2465,2466,2467,2468,2469,2470,2471],{"id":59,"depth":904,"text":60},{"id":107,"depth":904,"text":108},{"id":154,"depth":904,"text":155},{"id":226,"depth":904,"text":227},{"id":363,"depth":904,"text":364},{"id":410,"depth":904,"text":411},{"id":461,"depth":904,"text":462},{"id":485,"depth":898,"text":486,"children":2473},[2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2486],{"id":495,"depth":904,"text":496},{"id":539,"depth":904,"text":540},{"id":599,"depth":904,"text":600},{"id":633,"depth":904,"text":634},{"id":789,"depth":904,"text":790},{"id":871,"depth":904,"text":872},{"id":1222,"depth":904,"text":1223},{"id":1249,"depth":904,"text":1250},{"id":1641,"depth":904,"text":1642},{"id":2087,"depth":904,"text":2088},{"id":2154,"depth":904,"text":2485},"A peek ahead: how Java's Set interface looks",{"id":2297,"depth":904,"text":2298},{"id":2420,"depth":898,"text":2421},"2026-05-12","If you're new to data structures, the very first hurdle isn't a fancy algorithm — it's a way of thinking. Programmers separate what a thing does from how it's built. That's the whole idea behind an Abstract Data Type (ADT), and once it clicks, the rest of the course starts to feel much more organized.",false,"2026-05-13","md",null,{},true,"\u002Fblog\u002FAbstract-Data-Types-&-The-Bag",{"title":5,"description":2489},{"loc":2496},"blog\u002FAbstract-Data-Types-&-The-Bag","7lon_BVLnmwmYuV6r5uFdPUQvP1uFFpTCUfTL1nd9L8",114,{"id":2503,"extension":2504,"meta":2505,"series":2506,"stem":2616,"__hash__":2617},"series\u002Fseries.json","json",{},{"微積分教學":2507,"生活紀錄":2510,"Motor Control":2512,"生活隨筆":2526,"Motor learning":2530,"小兒物治":2548,"中風":2563,"平衡":2576,"Network Communication":2586,"CSA":2593,"機器學習":2599,"小腦":2603,"SCI脊髓損傷":2612},[2508,2509],"微積分隨筆-未完成版","2025數學回顧",[2511],"一個漂流到地球的故事",[2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525],"控制自己-Be-water-my-friend","控制自己-Be-water-my-friend（二）","控制自己-Be-water-my-friend（三）","控制自己-Be-water-my-friend（四）","控制自己-Be-water-my-friend（五）","進階控制制制制","周圍理論學派（一）反射理論","周圍理論學派（二）階層理論","中樞理論學派（一）CPG","中樞理論學派（二）Motor-Program","模組理論","系統理論","動態模組理論",[2527,2528,2529],"你好，世界。","根本沒人在乎你的部落格","早安-午安-晚安",[2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547],"動作學習（一）介紹","動作學習（二）form-of-learning","動作學習（三）Measurement-of-learning","動作學習（四）理論","動作學習（五）理論-2","動作學習（六）理論-3","動作學習（七）練習方式-1","動作學習（八）練習方式-2","動作學習（九）回饋-1","動作學習（十）回饋-2-擴增性(KR)","動作學習（十一）回饋-3-擴增性(KP)","動作學習（十一）回饋-4-(間隔+物理引導)","動作學習（十二）神經可塑性","動作學習（十二）神經可塑性2","動作學習（十三）臨床應用","動作學習（十四）記憶","動作學習（十五）影響表現的因素",[2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562],"腦性痲痺-CP","CP補充（一）","CP—Rood-&-Bobath","CP—Rood-&-Bobath（二）","Motor-Learning","Motor-Learning小兒（二）","Gait-analysis小兒（一）","Gait-analysis小兒（二）","小兒發展（一）","小兒發展（二）","小兒發展（三）","小兒發展（四）","小兒發展（五）","GMFCS",[2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575],"腦血管病變（CVA）（中風）(一)","CVA（二）","CVA（三）血管症候群-i","CVA（四）血管症候群-(ii)","CVA（四）","CVA（六）","CVA（七）評估-(i)","CVA（八）評估-(ii)","CVA（九）復健—手部-(i)","CVA（十）功能性走路","CVA（十一）功能性走路ii","CVA（十二）輔助用品",[2577,2578,2579,2580,2581,2582,2583,2584,2585],"平衡與前庭失調（一）","Balance（二）前庭覺-(i)","Balance（三）","Balance（四）評估","Balance（五）復健","Balance（六）功能恢復","Balance（七）前庭障礙","Balance（八）檢查","Balance（九）干預",[2587,2588,2589,2590,2591,2592],"Network-Communication,-Chapter-1","Network-Communication,-Chapter-2","Network-Communication,-Chapter-3","Network-Communication-Chapter-4","Network-Communications,-Chapter-5","Network-Communication,-Chapter-6",[2594,2595,2596,2597,2598],"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",[2600,2601,2602],"機器學習導論","資料前處理與迴歸分析","決策樹",[2604,2605,2606,2607,2608,2609,2610,2611],"小腦（一）","小腦（二）","小腦（三）功能","小腦（四）損傷","小腦（五）各功能障礙","小腦（六）評估","小腦（七）評估(ii)","小腦（八）治療",[2613,2614,2615],"脊髓損傷SCI（一）","SCI（二）受傷機制——創傷性（頸椎）","SCI（三）受傷機制--ii","series","OrQkztaCQ8PCQ3c33l2XQ4ZKtA6mZbR3LOKgfR0KR_M",[2619,2638,2658,2677,2694,2711,2726,2743,2761,2783],{"id":2620,"title":2621,"avatar":2622,"banner":2493,"bio":2623,"body":2624,"description":621,"extension":2492,"meta":2628,"name":2621,"navigation":2495,"path":2629,"seo":2630,"sitemap":2631,"social":2632,"stem":2636,"__hash__":2637},"authors\u002Fauthors\u002Fautomata.md","Automata","\u002Fimages\u002Fuploads\u002Fnier-automata-2b.jpg","一隻吐司天喵，漂浮在銀河星辰中",{"type":8,"value":2625,"toc":2626},[],{"title":621,"searchDepth":898,"depth":898,"links":2627},[],{},"\u002Fauthors\u002Fautomata",{"description":621},{"loc":2629},{"website":2633,"twitter":2634,"github":2635},"https:\u002F\u002Freurl.cc\u002FWOeM29","https:\u002F\u002Freurl.cc\u002FLnvLEy","https:\u002F\u002Fgithub.com\u002FAutomata-0","authors\u002Fautomata","IkVbO2zA7revgYq624iVWpSZQUyMmWa82tw_EbWXViE",{"id":2639,"title":2640,"avatar":2641,"banner":2642,"bio":2643,"body":2644,"description":621,"extension":2492,"meta":2648,"name":2649,"navigation":2495,"path":2650,"seo":2651,"sitemap":2652,"social":2653,"stem":2656,"__hash__":2657},"authors\u002Fauthors\u002Fchinono.md","Chinono","\u002Fimages\u002Fuploads\u002F103467998_p0 copy.png","\u002Fimages\u002Fbackground_light.jpg","我不是女生！",{"type":8,"value":2645,"toc":2646},[],{"title":621,"searchDepth":898,"depth":898,"links":2647},[],{},"七糯糯","\u002Fauthors\u002Fchinono",{"description":621},{"loc":2650},{"github":2654,"twitter":621,"website":2655},"https:\u002F\u002Fgithub.com\u002FChinHongTan","https:\u002F\u002Fchinono.dev","authors\u002Fchinono","jj1J9mFh3InZFL6XtCzGBQ5jPip0EwBDE3mjGvnN6jE",{"id":2659,"title":2660,"avatar":2661,"banner":2662,"bio":2663,"body":2664,"description":621,"extension":2492,"meta":2668,"name":2669,"navigation":2495,"path":2670,"seo":2671,"sitemap":2672,"social":2673,"stem":2675,"__hash__":2676},"authors\u002Fauthors\u002Fhibiki12141132.md","Hibiki12141132","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F265822020?v=4","\u002Fimages\u002Fuploads\u002F1773978423557-___.jpg","享受著知識強姦大腦的過程 (內文含個人發癲 不要再意)",{"type":8,"value":2665,"toc":2666},[],{"title":621,"searchDepth":898,"depth":898,"links":2667},[],{},"HiBiKi","\u002Fauthors\u002Fhibiki12141132",{"description":621},{"loc":2670},{"github":2674,"twitter":621},"https:\u002F\u002Fgithub.com\u002FHiBiKi12141132","authors\u002Fhibiki12141132","dbRnKEcYeCH_faD8R7AUmPPcwgc26s_fR4Q_lu4qtA4",{"id":2678,"title":2679,"avatar":2680,"banner":2493,"bio":2681,"body":2682,"description":621,"extension":2492,"meta":2686,"name":2679,"navigation":2495,"path":2687,"seo":2688,"sitemap":2689,"social":2690,"stem":2692,"__hash__":2693},"authors\u002Fauthors\u002Fmahiro.md","Mahiro","https:\u002F\u002Ftruth.bahamut.com.tw\u002Fs01\u002F202601\u002F2a29b047d341f840b2ce89f7d65b2ba3.JPG","一個致力於逃離新竹的電機系小雜魚",{"type":8,"value":2683,"toc":2684},[],{"title":621,"searchDepth":898,"depth":898,"links":2685},[],{},"\u002Fauthors\u002Fmahiro",{"description":621},{"loc":2687},{"github":2691},"https:\u002F\u002Fgithub.com\u002Fwifekurumi","authors\u002Fmahiro","b435tdWu9eXUf06WroCge0I405cqA0FhLlUUhoPk14k",{"id":2695,"title":2696,"avatar":2697,"banner":2493,"bio":2698,"body":2699,"description":621,"extension":2492,"meta":2703,"name":2696,"navigation":2495,"path":2704,"seo":2705,"sitemap":2706,"social":2707,"stem":2709,"__hash__":2710},"authors\u002Fauthors\u002Fosborrrrn.md","Osborrrrn","\u002Fimages\u002Fuploads\u002Frectangle_large_type_2_c516437ed713e5de1f7d2dca8a20cd81.jpg","別人笑我太瘋癲，我笑他人看不穿。\n不見五陵豪傑墓，無花無酒鋤就田",{"type":8,"value":2700,"toc":2701},[],{"title":621,"searchDepth":898,"depth":898,"links":2702},[],{},"\u002Fauthors\u002Fosborrrrn",{"description":621},{"loc":2704},{"github":2708},"https:\u002F\u002Fgithub.com\u002FOsborrrrn","authors\u002Fosborrrrn","w6VWZKPUwvXn5i7MKXOpU2Jeqr3BrdTKVCeDOF2jZlU",{"id":2712,"title":2713,"avatar":2493,"banner":2493,"bio":2714,"body":2715,"description":621,"extension":2492,"meta":2719,"name":2713,"navigation":2495,"path":2720,"seo":2721,"sitemap":2722,"social":2723,"stem":2724,"__hash__":2725},"authors\u002Fauthors\u002F法法.md","法法","123",{"type":8,"value":2716,"toc":2717},[],{"title":621,"searchDepth":898,"depth":898,"links":2718},[],{},"\u002Fauthors\u002F法法",{"description":621},{"loc":2720},{"github":621},"authors\u002F法法","o5pdVuPCfTmhkDCpvgy4YmAP0CGdvFluPvjhgvQVbsI",{"id":2727,"title":2728,"avatar":2729,"banner":2493,"bio":2730,"body":2731,"description":621,"extension":2492,"meta":2735,"name":2728,"navigation":2495,"path":2736,"seo":2737,"sitemap":2738,"social":2739,"stem":2741,"__hash__":2742},"authors\u002Fauthors\u002F灰海獅.md","灰海獅","\u002Fimages\u002Fuploads\u002Fimg_3279.jpeg","守夜人",{"type":8,"value":2732,"toc":2733},[],{"title":621,"searchDepth":898,"depth":898,"links":2734},[],{},"\u002Fauthors\u002F灰海獅",{"description":621},{"loc":2736},{"github":2740},"https:\u002F\u002Fgithub.com\u002Fyuiri333","authors\u002F灰海獅","iZoSIFbQdS-6v3LiK1txgxnIMKy-d2CyZXQk9CMua_s",{"id":2744,"title":2745,"avatar":2746,"banner":2747,"bio":2748,"body":2749,"description":621,"extension":2492,"meta":2753,"name":2745,"navigation":2495,"path":2754,"seo":2755,"sitemap":2756,"social":2757,"stem":2759,"__hash__":2760},"authors\u002Fauthors\u002F花夜.md","花夜","\u002Fimages\u002Fuploads\u002F1772719470518-791_20260218161129.png","\u002Fimages\u002Fuploads\u002Fimg_2446.png","無論你身在何處，我都會在這裡等你",{"type":8,"value":2750,"toc":2751},[],{"title":621,"searchDepth":898,"depth":898,"links":2752},[],{},"\u002Fauthors\u002F花夜",{"description":621},{"loc":2754},{"github":2758,"twitter":621},"https:\u002F\u002Fgithub.com\u002Fflowernight0709","authors\u002F花夜","a7jeQiF_JkawgYIR-aYSGceJdDP6Z-OWydsICvgSIzs",{"id":2762,"title":2763,"avatar":2764,"banner":2765,"bio":2766,"body":2767,"description":2771,"extension":2492,"meta":2774,"name":2763,"navigation":2495,"path":2775,"seo":2776,"sitemap":2777,"social":2778,"stem":2781,"__hash__":2782},"authors\u002Fauthors\u002F輝月.md","輝月","\u002Fimages\u002Fuploads\u002Ffb_img_1771085634823.jpg","\u002Fimages\u002Fuploads\u002Fimg_1751.jpg","天下布魔好好玩",{"type":8,"value":2768,"toc":2772},[2769],[11,2770,2771],{},"準大學生，目前正在製作TFR模組",{"title":621,"searchDepth":898,"depth":898,"links":2773},[],{},"\u002Fauthors\u002F輝月",{"description":2771},{"loc":2775},{"twitter":2779,"github":2780},"https:\u002F\u002Fx.com\u002Fhuiyue945","https:\u002F\u002Fgithub.com\u002Fhuiyueyea","authors\u002F輝月","koUocBihphDy3453-nAcolM7JJYwI7UMBpVkf1JQrMQ",{"id":2784,"title":2785,"avatar":2786,"banner":2493,"bio":2787,"body":2788,"description":2792,"extension":2492,"meta":2805,"name":2785,"navigation":2495,"path":2806,"seo":2807,"sitemap":2808,"social":2809,"stem":2811,"__hash__":2812},"authors\u002Fauthors\u002F阿西狄亞.md","阿西狄亞","\u002Fimages\u002Fuploads\u002Fimg_20251215_121849_589.jpg","君は実に馬鹿だな",{"type":8,"value":2789,"toc":2803},[2790,2793],[11,2791,2792],{},"我是阿西狄亞，阿西狄亞的阿，阿西狄亞的西，阿西狄亞的狄，阿西狄亞的亞，你可以叫我阿西。",[11,2794,2795,2798,2799,2802],{},[20,2796,2797],{},"我說的所有事情都抱有極度主觀的看法以及意見","，如果你有其他想法，",[20,2800,2801],{},"你是對的","。",{"title":621,"searchDepth":898,"depth":898,"links":2804},[],{},"\u002Fauthors\u002F阿西狄亞",{"description":2792},{"loc":2806},{"github":2810},"https:\u002F\u002Fgithub.com\u002FAcedia0130","authors\u002F阿西狄亞","q5ECEDl8-0Y33tPck0lYZnzPjFdJkrOnBN7HkAO3pls",[],[2815,2824,2833,2842,2851,2860,2869,2878,2887,2898],{"id":2620,"title":2621,"avatar":2622,"banner":2493,"bio":2623,"body":2816,"description":621,"extension":2492,"meta":2820,"name":2621,"navigation":2495,"path":2629,"seo":2821,"sitemap":2822,"social":2823,"stem":2636,"__hash__":2637},{"type":8,"value":2817,"toc":2818},[],{"title":621,"searchDepth":898,"depth":898,"links":2819},[],{},{"description":621},{"loc":2629},{"website":2633,"twitter":2634,"github":2635},{"id":2639,"title":2640,"avatar":2641,"banner":2642,"bio":2643,"body":2825,"description":621,"extension":2492,"meta":2829,"name":2649,"navigation":2495,"path":2650,"seo":2830,"sitemap":2831,"social":2832,"stem":2656,"__hash__":2657},{"type":8,"value":2826,"toc":2827},[],{"title":621,"searchDepth":898,"depth":898,"links":2828},[],{},{"description":621},{"loc":2650},{"github":2654,"twitter":621,"website":2655},{"id":2659,"title":2660,"avatar":2661,"banner":2662,"bio":2663,"body":2834,"description":621,"extension":2492,"meta":2838,"name":2669,"navigation":2495,"path":2670,"seo":2839,"sitemap":2840,"social":2841,"stem":2675,"__hash__":2676},{"type":8,"value":2835,"toc":2836},[],{"title":621,"searchDepth":898,"depth":898,"links":2837},[],{},{"description":621},{"loc":2670},{"github":2674,"twitter":621},{"id":2678,"title":2679,"avatar":2680,"banner":2493,"bio":2681,"body":2843,"description":621,"extension":2492,"meta":2847,"name":2679,"navigation":2495,"path":2687,"seo":2848,"sitemap":2849,"social":2850,"stem":2692,"__hash__":2693},{"type":8,"value":2844,"toc":2845},[],{"title":621,"searchDepth":898,"depth":898,"links":2846},[],{},{"description":621},{"loc":2687},{"github":2691},{"id":2695,"title":2696,"avatar":2697,"banner":2493,"bio":2698,"body":2852,"description":621,"extension":2492,"meta":2856,"name":2696,"navigation":2495,"path":2704,"seo":2857,"sitemap":2858,"social":2859,"stem":2709,"__hash__":2710},{"type":8,"value":2853,"toc":2854},[],{"title":621,"searchDepth":898,"depth":898,"links":2855},[],{},{"description":621},{"loc":2704},{"github":2708},{"id":2712,"title":2713,"avatar":2493,"banner":2493,"bio":2714,"body":2861,"description":621,"extension":2492,"meta":2865,"name":2713,"navigation":2495,"path":2720,"seo":2866,"sitemap":2867,"social":2868,"stem":2724,"__hash__":2725},{"type":8,"value":2862,"toc":2863},[],{"title":621,"searchDepth":898,"depth":898,"links":2864},[],{},{"description":621},{"loc":2720},{"github":621},{"id":2727,"title":2728,"avatar":2729,"banner":2493,"bio":2730,"body":2870,"description":621,"extension":2492,"meta":2874,"name":2728,"navigation":2495,"path":2736,"seo":2875,"sitemap":2876,"social":2877,"stem":2741,"__hash__":2742},{"type":8,"value":2871,"toc":2872},[],{"title":621,"searchDepth":898,"depth":898,"links":2873},[],{},{"description":621},{"loc":2736},{"github":2740},{"id":2744,"title":2745,"avatar":2746,"banner":2747,"bio":2748,"body":2879,"description":621,"extension":2492,"meta":2883,"name":2745,"navigation":2495,"path":2754,"seo":2884,"sitemap":2885,"social":2886,"stem":2759,"__hash__":2760},{"type":8,"value":2880,"toc":2881},[],{"title":621,"searchDepth":898,"depth":898,"links":2882},[],{},{"description":621},{"loc":2754},{"github":2758,"twitter":621},{"id":2762,"title":2763,"avatar":2764,"banner":2765,"bio":2766,"body":2888,"description":2771,"extension":2492,"meta":2894,"name":2763,"navigation":2495,"path":2775,"seo":2895,"sitemap":2896,"social":2897,"stem":2781,"__hash__":2782},{"type":8,"value":2889,"toc":2892},[2890],[11,2891,2771],{},{"title":621,"searchDepth":898,"depth":898,"links":2893},[],{},{"description":2771},{"loc":2775},{"twitter":2779,"github":2780},{"id":2784,"title":2785,"avatar":2786,"banner":2493,"bio":2787,"body":2899,"description":2792,"extension":2492,"meta":2911,"name":2785,"navigation":2495,"path":2806,"seo":2912,"sitemap":2913,"social":2914,"stem":2811,"__hash__":2812},{"type":8,"value":2900,"toc":2909},[2901,2903],[11,2902,2792],{},[11,2904,2905,2798,2907,2802],{},[20,2906,2797],{},[20,2908,2801],{},{"title":621,"searchDepth":898,"depth":898,"links":2910},[],{},{"description":2792},{"loc":2806},{"github":2810},1778667337045]