![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
liusha0007
这个作者很懒,什么都没留下…
展开
-
选择排序算法
各种简单排序时公司面试笔试的喜好。分享一下书中源码,大家可以根据需要改写。 class ArraySel{ private long[]a; //封装long类型数组a[] private int nElems; //数据量 public ArraySel(int max){ //构造 a=new long[max]; //创建一个数组...2009-09-13 17:10:57 · 70 阅读 · 0 评论 -
插入排序算法
简单排序算法中速度比较快的一个算法。 class ArrayIns{ private long[]a; //封装long类型数组a[] private int nElems; //数据量 public ArrayIns(int max){ //构造 a=new long[max]; //创建一个数组 nElems=0; ...2009-09-13 20:05:29 · 73 阅读 · 0 评论 -
常用简单排序算法汇总:冒泡+选择+插入
简单排序算法是我们学习数据结构首先接触到的,也是企业面试易考的。重温一下 class ArraySort{ private long[]a; //封装long类型数组a[] private int nElems; //数据量 public ArraySort(int max){ //构造 a=new long[max]; //创建一个数组 ...2009-09-13 20:56:31 · 112 阅读 · 0 评论 -
冒泡排序
class ArrayBub{ private long[]a; //封装long类型数组a[] private int nElems; //数据量 public ArrayBub(int max){ //构造 a=new long[max]; //创建一个数组 nElems=0; //初始为空 } //将元素添加...2009-08-23 15:26:23 · 69 阅读 · 0 评论 -
栈的基本认识
public class Stack{ public static void main(String args[]){ Stackx theStack = new Stackx(10); theStack.push(12); theStack.push(13); theStack.push(14); theStack.push(15); ...2009-09-10 00:21:27 · 81 阅读 · 0 评论 -
栈的变相面试题:(将字符串逆序)
写一个算法,将字符串逆序 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class ReverseApp{ public static void main(String args[]) throws IOExcepti...2009-09-10 01:33:07 · 219 阅读 · 0 评论