会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小帅学java
别那么骄傲,一定要虚心学习,保持虚心
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
17
18
19
20
21
22
23
下一页
2019年8月23日
移除链表元素(三种方法)
摘要: 删除链表中等于给定值 val 的所有节点。 示例: 输入: 1->2->6->3->4->5->6, val = 6输出: 1->2->3->4->5 不使用虚拟头节点: /** * Definition for singly-linked list....
阅读全文
posted @ 2019-08-23 14:01 小帅学java
阅读(47)
评论(0)
推荐(0)
2019年8月22日
使用链表实现队列
摘要: 队列接口: public interface Queue { int getSize(); boolean isEmpty(); void enqueue(E e); E dequeue(); E getFront();} 实现类: public class ...
阅读全文
posted @ 2019-08-22 11:30 小帅学java
阅读(11)
评论(0)
推荐(0)
2019年8月21日
链表的增删改查操作
摘要: public class LinkedList { private class Node { public E e; public Node next; public Node(E e, Node next) { this.e = e; this...
阅读全文
posted @ 2019-08-21 14:13 小帅学java
阅读(21)
评论(0)
推荐(0)
2019年8月18日
循环队列
摘要: 接口: public interface Queue { int getSize(); boolean isEmpty(); void enqueue(E e); E dequeue(); E getFront();} 实现类: public class Lo...
阅读全文
posted @ 2019-08-18 19:07 小帅学java
阅读(6)
评论(0)
推荐(0)
2019年8月17日
有效的括号
摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 注意空字符串可被认为是有效字符串。 示例 1: 输入: "()" 输出: tr...
阅读全文
posted @ 2019-08-17 14:17 小帅学java
阅读(27)
评论(0)
推荐(0)
2019年8月15日
动态数组(扩容和缩容)
摘要: // 在第index个位置插入一个新元素e public void add(int index, E e) { if (index size) { throw new IllegalArgumentException("Add failed. Req...
阅读全文
posted @ 2019-08-15 19:28 小帅学java
阅读(22)
评论(0)
推荐(0)
数组使用泛型来完成增删改查操作
摘要: public class Array { private E[] data; private int size; public Array(int capacity) { data = (E[]) new Object[capacity]; size = ...
阅读全文
posted @ 2019-08-15 13:42 小帅学java
阅读(23)
评论(0)
推荐(0)
2019年8月14日
数据结构------数组中删除元素
摘要: // 从数组中删除index位置的元素,返回删除的元素 public int remove(int index) { if (index = size) { throw new IllegalArgumentException("Remove faile...
阅读全文
posted @ 2019-08-14 23:19 小帅学java
阅读(58)
评论(0)
推荐(0)
数据结构------数组中查询元素和修改元素
摘要: // 获取index索引位置的元素 public int get(int index) { if (index = size) { throw new IllegalArgumentException("Get failed. Index is ill...
阅读全文
posted @ 2019-08-14 13:15 小帅学java
阅读(16)
评论(0)
推荐(0)
2019年8月13日
数据结构------向数组中添加元素
摘要: //size是数组的第一个空元素的定位符。 //向所有元素后添加一个新元素 public void addLast(int e) {// if(size==data.length) {// throw new IllegalArgumentExcept...
阅读全文
posted @ 2019-08-13 15:06 小帅学java
阅读(52)
评论(0)
推荐(0)
上一页
1
···
17
18
19
20
21
22
23
下一页
公告