...

/

Stack (Implementation)

Stack (Implementation)

In this lesson, you are going to look at how stacks are implemented in C# and how the main stack functions actually work.

Introduction

Most programming languages come with the stack data structure built-in. In Rust,you do not have stack as in built-type. However, you can implement a stack using vectors easily in Rust.

Implementation

Stacks can be implemented by using arrays or linked lists. Each implementation has its own advantages and disadvantages. However, this lesson will show an implementation of stacks using vectors.

As mentioned in the previous lesson, a typical stack must contain the following functions:

  • push(value)
...
Access this course and 1400+ top-rated courses and projects.