data structures "roses are redviolets are bluelists are mutableand so is set foodata structures are central theme in most programseven if python programmers often don' need to care their apathy is warranted--python comes "out of the boxwith rich set of built-in and already optimized types that make it easy to deal with structured datalistsstringstuplesdictionariessetsand the like for simple systemsthese types are usually enough dictionariesfor examplesubsume many of the classical searching algorithmsand lists replace much of the work you' do to support collections in lower-level languages even soboth are so easy to use that you generally never give them second thought but for advanced applicationswe may need to add more sophisticated types of our own to handle extra requirements or special cases in this we'll explore handful of advanced data structure implementations in pythonsetsstacksgraphsand so on as we'll seedata structures can take the form of new object types in pythonintegrated into the language' type model that isobjects we code in python become full-fledged datatypes--to the scripts that use themthey can look and feel just like built-in listsnumbersand dictionaries although the examples in this illustrate advanced programming and computer science techniquesthey also underscore python' support for writing reusable software as object implementations are coded with classes and modulesthey naturally become generally useful components that can be used in any program that imports them in effectwe will be building libraries of data structure toolswhether we plan for it or not moreoverthough most examples in this are pure python code (and at least to linear readerssome may seem relatively simple compared to those of earlier )they also provide use case for discussing python performance issuesand hint at what' possible with the subject of --from the most general perspectivenew