Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
306
306Ass5
Commits
3d27f6c3
Commit
3d27f6c3
authored
Mar 26, 2019
by
michael lundquist
Browse files
Spiffing up the linked list queue
parent
fa96d939
Changes
2
Show whitespace changes
Inline
Side-by-side
fifthassignment/src/main/java/com/ds/fifthassignment/LinkedListQueue.java
View file @
3d27f6c3
...
...
@@ -31,7 +31,8 @@ public class LinkedListQueue implements Iterable{
if
(
data
.
isEmpty
())
{
throw
new
RuntimeException
(
"QueueUnderflow!"
);
}
else
{
Object
out
=
head
;
else
{
Object
out
=
head
;
data
.
removeFirst
();
if
(!
data
.
isEmpty
())
head
=
data
.
getFirst
();
else
head
=
null
;
...
...
fifthassignment/src/test/java/com/ds/fifthassignment/AppTest.java
View file @
3d27f6c3
...
...
@@ -143,11 +143,12 @@ public class AppTest
public
void
test_LL_QueueElement
(){
Integer
test
=
randRange
(
1
,
10
);
LinkedListQueue
q
=
new
LinkedListQueue
();
q
.
add
(
"b"
);
for
(
int
k
=
1
;
k
<=
10
;
k
++){
q
.
push
(
"a"
);
q
.
add
(
"a"
);
}
q
.
push
(
"b"
);
assertTrue
(
true
);
assertTrue
(
q
.
remove
().
equals
(
"b"
)
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment