Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elizabeth - Leaves #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Elizabeth - Leaves #46

wants to merge 1 commit into from

Conversation

north108
Copy link

@north108 north108 commented Mar 6, 2020

Turning in what I have so far.

Stacks and Queues

Thanks for doing some brain yoga. You are now submitting this assignment!

Comprehension Questions

Question Answer
What is an ADT?
Describe a Stack
What are the 5 methods in Stack and what does each do?
Describe a Queue
What is the difference between implementing something and using something?
When is a circular buffer advantageous over a dynamic array or LinkedList?

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! You hit all the learning goals here. Excellent work!

@store = Array.new(10)
@size = 10
@front = -1
@front = -1
end

def enqueue(element)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

else
@store[@back] = element
@back = (@back + 1) % @size
end
end

def dequeue

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , Well done!

@@ -22,10 +43,16 @@ def size
end

def empty?
raise NotImplementedError, "Not yet implemented"
return @front == -1
end

def to_s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants