-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDKQueue.h
More file actions
executable file
·31 lines (25 loc) · 768 Bytes
/
DKQueue.h
File metadata and controls
executable file
·31 lines (25 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
// DKQueue.h
//
// Created by Dominik Krejčík on 25/09/2011.
// Feel free to use and distribute as long as you mention me. Or buy me a beer.
//DKQueue - FIFO (first in first out) data structure for Objective-C
#import <Foundation/Foundation.h>
@interface DKQueue : NSObject {
NSMutableArray* array;
}
// Removes and returns the element at the front of the queue
-(id)dequeue;
// Add the element to the back of the queue
-(void)enqueue:(id)element;
// Remove all elements
-(void)enqueueElementsFromArray:(NSArray*)arr;
-(void)enqueueElementsFromQueue:(DKQueue*)queue;
-(void)clear;
// Returns the element at the front of the queue
-(id)peek;
// Returns YES if the queue is empty
-(BOOL)isEmpty;
// Returns the size of the queue
-(NSInteger)size;
@end