⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myvector.java

📁 用c编写的数据内部排序方法,可在窗口中选择多种排序方法,如快排,冒泡,折半插入等,还可以选择排序数据的个数,初态,控制等.
💻 JAVA
字号:
package main.myClass;

import main.myPanel;

public class myVector{
	myPanel[] my;
	int current=0;
	int max=10;
	
	public myVector(){
		my=new myPanel[max];
	}
	
	public myVector(int c){
		my=new myPanel[c];
		max=c;
	}
	
	public void put(myPanel m){
		my[current++]=m;
		if(current==max){
			myPanel[] temp=new myPanel[(int)(max*3/2)];
			for(int i=0;i<max;i++)
				temp[i]=my[i];
			my=temp;
			max=(int)(max*3/2);
		}
	}
	
	public int remove(myPanel m){
		int j=0;
		if(m!=null){
			for(int i=0;i<current;i++){
				if(my[i].equals(m)){
					j=i;
					break;
				}
			}
			for(int i=j;i<current;i++)
				my[i]=my[i+1];
			for(int i=current;i<10;i++)
				my[i]=null;
			current--;
			return j;
		}
		else 
			return -1;
	}
	
	public myPanel[] mypanels(){
		return my;
	}
	
	public int size(){
		return current;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -