codingtestgo2's People
codingtestgo2's Issues
(3) `Stack` のテスト作成
問題3
問題2のStack
が仕様を満たしていることを確認するテストを書いてください。
(1) インターフェイス `Stackable` の定義
問題1
string
型のデータを格納するクラス Stack
を実現するための interface である Stackable
を定義してください。ただし、 Stack
は以下の条件を満たすものとします。
- 条件1:LIFO
- 条件2:
Push
メソッドで任意の値を追加できること - 条件3:
Pop
メソッドで最後に追加した要素を削除し、その値をreturnすること
参考
スタックは要素の挿入と削除がリストの先頭だけで行われるLIFOのデータ構造です。
LIFO(Last In, First Out) とは「最後に入ったものが最初に出てゆく」という意味です。
積み重なった本をイメージするとわかりやすいです。最初に置かれたものは底にあって、
最後に置かれたものは最上に位置します。最初に置かれたものを取り出すには最後に置かれたものを順番に取り出していかなければなりません。
スタックでは要素を挿入する(積む)操作を push 、要素を削除する(取り出す)操作を pop と言います。またリストの先頭(頂上)を top 、終端(底)を bottom と呼びます。
(4) interface `Stack` をメンバに持つ構造体 `Hoge` の実装
問題4
interface Stack
をメンバに持つ構造体 Hoge
の実装 をしてください
さらにStack
をmockにしたテストを書いてください
(2) インターフェイス `Stackable` の実装
問題2
問題1で定義した Stackable
をstruct Stack
に実装してください。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.