当前位置: 首页 > news >正文

网站建设bannerseo专员很难吗

网站建设banner,seo专员很难吗,创意品牌网站,网站开发费是无形资产吗题目地址:https://leetcode.com/submissions/detail/88638615/,https://leetcode.com/submissions/detail/88638372/ 无论是用栈实现队列还是用队列实现栈,在Java中提供给了我们LinkedList这样一个容器,它的操作足以满足我们模拟…

题目地址:https://leetcode.com/submissions/detail/88638615/https://leetcode.com/submissions/detail/88638372/

无论是用栈实现队列还是用队列实现栈,在Java中提供给了我们LinkedList这样一个容器,它的操作足以满足我们模拟队列与栈的操作。

队列模拟栈

public class ImplementStackUsingQueues {LinkedList<Integer> queue = new LinkedList<>();// Push element x onto stack.public void push(int x) {queue.push(x);}// Removes the element on top of the stack.public void pop() {queue.pop();}// Get the top element.public int top() {return queue.peek();}// Return whether the stack is empty.public boolean empty() {return queue.size() == 0 ? true : false;}
}

栈模拟队列:

public class ImplementQueueUsingStacks {LinkedList<Integer> stack = new LinkedList<>();// Push element x to the back of queue.public void push(int x) {stack.add(x);}// Removes the element from in front of queue.public void pop() {stack.pop();}// Get the front element.public int peek() {return stack.peek();}// Return whether the queue is empty.public boolean empty() {return stack.size() == 0 ? true : false;}@Overridepublic String toString() {return stack.toString();}public static void main(String[] args) {ImplementQueueUsingStacks queue = new ImplementQueueUsingStacks();queue.push(1);queue.push(2);queue.push(3);queue.push(4);System.out.println(queue);System.out.println(queue.peek());queue.pop();System.out.println(queue.peek());System.out.println(queue.empty());queue.pop();System.out.println(queue);}
}
http://www.lbrq.cn/news/2662435.html

相关文章:

  • 合肥网站建设服务平台网络营销事件
  • ui网站设计模板最近一周新闻大事摘抄2022年
  • 绍兴企业网站推广seo下拉优化
  • 外贸php网站源码seo内容优化心得
  • 青岛网站建设公司怎么选优化网络搜索引擎
  • wordpress收不到网站搜索引擎优化实训心得
  • 怎么做二手房网站站长工具是什么意思
  • 浙江网站建设前十的公司bt磁力
  • 网站怎么备案百度seo关键词排名优化教程
  • 企业网站改版建议百度手机版网址
  • 电商行业网站建设及维护城市更新论坛破圈
  • 张店政府网站建设哪家好360优化大师官方下载最新版
  • phpcms建站教程搜狗搜索引擎推广
  • 提供网站建设小程序制作网络营销管理
  • 怎么看网站有没有做竞价今天高清视频免费播放
  • 响应式网站开发遇到的问题如何开发软件app
  • 网站建设基本范例百度排行榜
  • 北海做网站哪家好外链群发
  • 二手书哪个网站做的好搜索引擎优化的方法包括
  • 重庆网站建设哪家公司好中国今天刚刚发生的新闻
  • 在线网页转pdf单页网站排名优化
  • 鹰潭门户网站建设费用安阳seo
  • 什么是网站备案广告竞价推广
  • 做网站 什么语言威海seo
  • 网络营销研究背景及意义seo顾问是干什么
  • app网站开发学习什么是seo标题优化
  • 如何对网站管理网络seo哈尔滨
  • 校友网站 建设百度榜单
  • 孝感网站建设公司短视频营销案例
  • 什么样的网站需要认证百度认证平台官网
  • JUC学习笔记-----ReentrantLock
  • Qt—— 下载、工具介绍以及新建项目
  • Elasticsearch 搜索模板(Search Templates)把“可配置查询”装进 Mustache
  • DBAPI 实现不同角色控制查看表的不同列
  • 【0基础PS】PS工具详解--缩放工具
  • C语言指针完全指南:从入门到精通