paint-brush
Understanding LinkedList Data Structure in Rubyby@yair
679 reads
679 reads

Understanding LinkedList Data Structure in Ruby

by Yair6mApril 21st, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In this article, we will create a singly LinkedList from scratch and explain how this data structure works and what it is useful for. The Big O time complexity to retrieve elements is 0(n) In a linked list, we can not retrieve an element by its index like in arrays. This is similar to an array because we can use both to store linear data. Linked lists need less space in memory than arrays and are dynamic and can expand its size. We will start by adding the add_first method to add a new element to our Linked list.

Coin Mentioned

Mention Thumbnail
featured image - Understanding LinkedList Data Structure in Ruby
Yair HackerNoon profile picture
Yair

Yair

@yair

L O A D I N G
. . . comments & more!

About Author

Yair HackerNoon profile picture
Yair@yair

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite