Summary

The current chapter covered the fundamentals of stacks and queues and also introduced implementation using R reference classes. We covered the fundamentals of stacks as a data structure which is based on the LIFO principle. The two types of stack implementation were introduced - array-based and linked list-based stacks along with a comparison of their computational and memory efficiencies. Recursion-based functions utilize stacks inherently, and are covered within the stack functionality. Queues are another very useful data structure that we covered. They follow the FIFO principle in addition and deletion of elements from the data structure. We discussed two types of queues - array-based queue and linked list-based queue implementation. ...

Get R Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.