Researchers did a study where they had students learn a relationship pattern between objects. Students were then broken down into 4 groups: a group that took the test 2o minutes later, a group that took the test 12 hours later but without sleep, a group that took the test 12 hours later and got sleep, and a group that took the test 24 hours later with a full night's sleep. The students that took the test 20 minutes later did the worst.
The researchers speculate:
"This strongly implies that sleep is actively engaged in the cognitive processing of our memories," notes Ellenbogen. "Knowledge appears to expand both over time and with sleep...Concludes Walker, "These findings point to an important benefit [of sleep] that we had not previously considered. Sleep not only strengthens a person's individual memories, it appears to actually knit them together and help realize how they are associated with one another. And this may, in fact, turn out to be the primary goal of sleep: You go to bed with pieces of the memory puzzle, and awaken with the jigsaw completed."