金坛住房和城乡建设局网站,wordpress模板文件是哪个,百度站内搜索的方法,北京公司招聘回顾
集合框架 两个重点——ArrayList和HashSet. Vector/ArraysList/LinkedList区别
VectorArraysListLinkedList底层实现数组数组链表线程安全安全不安全不安全增删效率较低较低高扩容*2*1.5-------- #xff08;#xff09;运算级最低#xff0c;记得加括号。 常…回顾
集合框架 两个重点——ArrayList和HashSet. Vector/ArraysList/LinkedList区别
VectorArraysListLinkedList底层实现数组数组链表线程安全安全不安全不安全增删效率较低较低高扩容*2*1.5-------- 运算级最低记得加括号。 常用Api
List* remove()的两种删除 API解释1add()添加2remove(index)索引删除3remove(Object)对象删除4set(index,e)《Set》修改5clear()清空6size()长度7get(index)《List》查询8indexOf()《List》找出位置9contains(用前要重写)包含10isEmpty()集合为空11itreator()迭代器遍历和删除12toString()转换为字符串
数组比较 Stack栈
后进先出 栈是一种特殊的数据结构后进先出。 结构 底层还是数组。Vector派生出来的继承Vector。 Api方法 push()入栈 peek()栈顶 取栈顶不会删除栈顶。 System.out.println(“栈顶:”stack.peek());//栈顶——最后进栈的 pop()出栈 出栈会删除栈顶元素。 System.out.println(“wu:”stack.pop());//出栈 完整代码
package com.ffyc.Stack;import java.util.Stack;public class StackDemo01 {public static void main(String[] args) {StackInteger stack new Stack();//存——压栈stack.push(1);stack.push(2);stack.push(3);stack.push(4);stack.push(5);System.out.println(栈stack);System.out.println(栈顶:stack.peek());//栈顶——最后进栈的//System.out.println(wu:stack.pop());//出栈//倒序打印while (stack.size()0){int temp stack.pop();//pop()后当前的栈顶元素自动删除System.out.println(temp);}}
}
反转hello 中间的回文数量的题可以用 计算器题目 准备工作 length-1 否则越界 ———————————————————————————————————————————— Queue队列 offer()进 队头添加数据 poll()出 从队头取出元素/数据 peek()顶 取出最先进队的元素。第一个offer()进去的元素。 是下面代码的输出queue.peek—1
队列 可排序的队列