Understanding LinkedList Data Structure in Rubyby@yair
467 reads

Understanding LinkedList Data Structure in Ruby

April 21st 2020
6 min
by @yair 467 reads
tldt arrow
Read on Terminal Reader🖨️

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
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa