zoukankan      html  css  js  c++  java
  • [CareerCup] 3.7 Adopt Animal 领养动物

    3.7 An animal shelter holds only dogs and cats, and operates on a strictly "first in, first out" basis. People must adopt either the "oldest" (based on arrival time) of all animals at the shelter, or they can select whether they would prefer a dog or a cat (and will receive the oldest animal of that type). They cannot select which specific animal they would like. Create the data structures to maintain this system and implement operations such as enqueue, dequeueAny, dequeueDog and dequeueCat.You may use the built-in LinkedList data structure.

  • 相关阅读:
    VS中使用svn注意事项
    后端调用WebApi
    抽象工厂模式
    观察者模式
    建造者模式
    外观模式
    模板方法
    原型模式
    工厂方法
    代理模式
  • 原文地址:https://www.cnblogs.com/grandyang/p/4682473.html
Copyright © 2011-2022 走看看