We use cookies to distinguish you from other users and to provide you with a better experience on our websites. Close this message to accept cookies or find out how to manage your cookie settings.
To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
A heap is a tree-based data structure that’s designed to quickly return the maximum or minimum of its items. Like a search tree, it maintains a special ordering among its nodes, and takes advantage of the hierarchical nature of binary trees to perform its operations in O(log n) time. Heaps are the primary implementation of the priority queue abstract data type. Like the first-in-first-out queues we studied in Chapter 13, a priority queue supports operations to insert and remove elements, but also maintains an ordering among its items. Polling the queue returns the next item according to the underlying ordering, rather than strictly returning items in FIFO order. Priority queues are used in applications that need to continually fetch the “next” item of a dynamic set that may change over time. A common application is ordering events by time in a simulation program.
This chapter describes the strengths and limitations of the methods that clinical scientists have used to determine if and how those various therapies work. These include box score reviews, within-subjects designs, between-subjects designs, and randomized controlled trials. The chapter contains a review of the latest research findings on the efficacy and effectiveness of established treatments as well as of alternative modes of intervention, with emphasis on the need to answer the “ultimate question” about psychotherapy, namely what treatment, by whom, is most effective for this individual with that specific problem, under which set of circumstances, and how does it come about? There is also a discussion about the internal and external validity of psychotherapy outcome research and how these factors affect clinical practice. The chapter concludes with a discussion of research on the effects of using psychoactive drugs, with or without psychotherapy, in the treatment of psychological disorders.
Bjerknes pointed out for the first time that the evolution of the atmosphere is governed by a complete set of seven equations with seven unknowns. If we know both the equations and the initial conditions with sufficient accuracy, we can predict the weather. In this chapter, we first introduce the continuous equations that govern the atmosphere. From these equations, we then discuss several fundamental wave oscillations existing in the atmosphere and their filtering approximations. For comparison, we then introduce the primitive equations for the oceans and discuss the Kelvin and Equatorially trapped waves, a special kind of waves that can appear in both the atmosphere and the ocean.
Seymour Papert published Mindstorms in 1980. Subtitled Children, Computers, and Powerful Ideas, the book advocated for making computational thinking a core part of the curriculum for young children (Papert, 1980). Mindstorms was influential in computer education circles, and the approaches it described were the first exposure to programming and computer science for many children. LEGO later adopted the name for a line of programmable building sets.
The previous two chapters introduced hash functions and hash tables. In this chapter, we’ll combine hash tables with lists to construct a search engine index. Our index will map a search word to the list of locations where that word occurs in a set of text documents. The data for our example search engine will come from the plays of William Shakespeare, the most influential English-language dramatist in history. We’ll work primarily with the text of Macbeth. The play provides a good development example because the text is rich enough to be interesting, but the structured script format makes it easy to extract everything we need with a reasonable amount of code.
The stack is the Incredible Hulk of data structures: superficially dumb, but so strong that it doesn’t matter. Stacks have only a few basic operations and they’re easy to implement, but they unlock a number of algorithms that are both theoretically powerful and practically important. You may recall that we previously discussed the role of the stack in recursion, and there’s a connection between the stack as an explicit data structure and recursive methods that use a stack implicitly.