Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0019ecb

Browse files
added notes fro 3.2 stacks and queues
1 parent c8dbda2 commit 0019ecb

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

‎_posts/2013-02-03-3.1-arrays_and_linked_lists.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ layout: post
33
title: 3.1 Arrays and linked lists
44
---
55

6+
* abstract data types: container (stack, queue), dictionary, priority queue
7+
* common data structures than can be used to implement them: arrays or linked lists and so on
68
* **Contiguously-allocated structures** are composed of single slabs of memory
79
* **Linked data structures** are composed of distinct chunks of memory bound together by pointers
810

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: post
3+
title: 3.2. Stacks and queues
4+
---
5+
6+
## Containers
7+
8+
* abstract data structure that permits storage and retrieval of data items independent of content
9+
* they're distinguished by the retrieval order they support
10+
* in stacks and queues this retrieval order depends on the insertion order
11+
12+
## Stacks
13+
14+
* support retrieval by last-in, first-out (LIFO) order
15+
* push - insert item at the top of the stack
16+
* pop - return (and remove) the top item of the stack
17+
18+
## Queues
19+
20+
* support retrieval in first in, first out (FIFO) order
21+
* minimize the maximum time spent waiting
22+
* (average waiting time will be the same regardless of whether FIFO or LIFO is used)
23+
* enqueue - insert an item at the back of the queue
24+
* dequeue - return (and remove) the front item from the queue
25+
26+
Both stacks and queues can be effectively implemented using either arrays or linked lists.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /