Skip to content

Conversation

@schanenR
Copy link

Linked List Comprehension Questions

Question Response
1. What advantages does a LinkedList have over an Array? You can allocate mem in diverse locations for when there is not a big enough continuous block of space for an array. You only use the needed memory space, never more.
2. When is an Array more advantageous? An array element can be accesses by the index directly. They don't need to use memory to hold pointer information.
3. What questions do you have about linked lists? We wrote a linked list class. Do most languages have a defined linked list class already?

@schanenR schanenR changed the title Forgot about commits : / Earth - Schanen Dec 15, 2020
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 Schanen, you hit the learning goals here. Nice work.

Just FYI you'd forked AdaGold instead of Ada-C14

Comment on lines +10 to 12
# Time complexity - O(1)
# Space complexity - O(1)
def add_first(data)

Choose a reason for hiding this comment

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

👍

Comment on lines +19 to 21
# Time complexity - O(1)
# Space complexity - O(1)
def get_first

Choose a reason for hiding this comment

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

👍

Comment on lines +28 to 30
# Time complexity - O(n)
# Space complexity - O(1)
def length

Choose a reason for hiding this comment

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

👍

Comment on lines +40 to 42
# Time complexity - O(n)
# Space complexity - O(1)
def add_last(data)

Choose a reason for hiding this comment

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

👍

Comment on lines +51 to 53
# Time complexity - O(n)
# Space complexity - O(1)
def get_last

Choose a reason for hiding this comment

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

👍

Comment on lines +60 to 62
# Time complexity - O(n)
# Space complexity - O(1)
def get_at_index(index)

Choose a reason for hiding this comment

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

What if index >= length

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