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

老司机做爰网站庆云网站seo

老司机做爰网站,庆云网站seo,长沙建企聘企业管理有限公司,小程序搜索排名帝搜sem880官网该楼层疑似违规已被系统折叠 隐藏此楼查看此楼以下简单实现了数据结构中的十字链表(Java实现):代码为添加(add)方法及求和(sum)方法,其它方法后续有时间再添加,最下面有测试方法CrossList交叉链表实现代码如下:package com.shxt.t…

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

以下简单实现了数据结构中的十字链表(Java实现):代码为添加(add)方法及求和(sum)方法,其它方法后续有时间再添加,最下面有测试方法

CrossList交叉链表实现代码如下:

package com.shxt.tengfei.metadata;

public class CrossList {

private Element base = null; //0元素

private int rowSize = 0;

private int columnSize = 0;

private int size = 0;

public CrossList() {

base = new Element(0, 0, null, null, null);

}

public int size() {

return size;

}

public void add(int row, int column, T d) {

Element rowTemp = base;

if (row > rowSize) {

while (rowTemp.down != null) {

rowTemp = rowTemp.down;

}

int newEleSize = row - rowSize;

for (int i = 0; i < newEleSize; i++) {

rowSize++;

Element newRowBase = new Element(rowSize, 0, null, null, null);

rowTemp.down = newRowBase;

rowTemp = rowTemp.down;

}

} else {

for (int i = 0; i < row; i++) {

rowTemp = rowTemp.down;

}

}

Element columnTemp = base;

if (column > columnSize) {

while (columnTemp.right != null) {

columnTemp = columnTemp.right;

}

int newEleSize = column - columnSize;

for (int i = 0; i < newEleSize; i++) {

columnSize++;

Element newColumnBase = new Element(0, columnSize, null, null, null);

columnTemp.right = newColumnBase;

columnTemp = columnTemp.right;

}

} else {

for (int i = 0; i < column; i++) {

columnTemp = columnTemp.right;

}

}

Element newEle = new Element(row, column, d, null, null);

if (rowTemp.right == null) {

rowTemp.right = newEle;

} else {

Element rightEle = rowTemp.right;

while (true) {

if (newEle.column < rightEle.column) {

newEle.right = rightEle;

rowTemp.right = newEle;

break;

}

else if (rightEle.right == null) {

rightEle.right = newEle;

break;

}

else {

rowTemp = rightEle;

rightEle = rightEle.right;

}

}

}

if (columnTemp.down == null) {

columnTemp.down = newEle;

} else {

Element downEle = columnTemp.down;

while (true) {

if (newEle.row < downEle.row) {

newEle.down = downEle;

columnTemp.down = newEle;

break;

}

else if (downEle.down == null) {

downEle.down = newEle;

break;

}

else {

columnTemp = downEle;

downEle = downEle.down;

}

}

}

size++;

}

public int[][] toArray() {

Element tempRowBase = base;

int[][] elements = new int[rowSize][columnSize];

while (tempRowBase.down != null) {

tempRowBase = tempRowBase.down;

Element tempColumnBase = tempRowBase;

while (tempColumnBase.right != null) {

tempColumnBase = tempColumnBase.right;

String strValue = tempColumnBase.data == null ? "0" : "" + tempColumnBase.data;

int value = Integer.parseInt(strValue);

elements[tempColumnBase.row - 1][tempColumnBase.column - 1] = value;

}

}

return elements;

}

public void print(int[][] array) {

for (int[] tempRow : array) {

for (int temp : tempRow) {

System.out.print(temp + "\t");

}

System.out.println();

}

}

public CrossList sum(CrossList second) {

int[][] fa = this.toArray();

int[][] sa = second.toArray();

CrossList overList = new CrossList();

boolean bCross = false;

if (fa.length == sa.length) {

for (int i = 0; i < fa.length; i++) {

if (fa[i].length != sa[i].length) {

break;

}

for (int j = 0; j < fa[i].length; j++) {

fa[i][j] = fa[i][j] + sa[i][j];

overList.add(i+1, j+1, fa[i][j]);

}

}

bCross = true;

}

return bCross ? overList : null;

}

class Element {

int row;

int column;

D data;

Element down;

Element right;

public Element(int r, int c, D d, Element down, Element right) {

row = r;

column = c;

data = d;

this.down = down;

this.right = right;

}

public String toString() {

return "[" + row + "," + column + " --> " + data + "]";

}

}

}

》》》》》》》》》》》》》》》》》》》》》》》》》》测试代码如下:

package com.shxt.tengfei.metadata;

public class TestCross {

public static void main(String[] args) {

CrossList cross1 = new CrossList();

//check new base

cross1.add(1, 1, -88);

cross1.add(3, 3, 99);

//insert a element (不影响其他元素)

cross1.add(2, 2, 1000);

//影响其他位置元素

cross1.add(2, 3, -5);

cross1.add(2, 1, 777);

cross1.print(cross1.toArray());

System.out.println("====================== cross1 end ========================\n");

CrossList cross2 = new CrossList();

cross2.add(1, 1, -66);

cross2.add(2, 2, 500);

cross2.add(3, 3, 35);

cross2.print(cross2.toArray());

System.out.println("====================== cross2 end ========================\n");

//cross1和cross2求和

CrossList cross3 = cross1.sum(cross2);

if (cross3 != null) {

cross3.print(cross3.toArray());

}

System.out.println("====================== sum(+) end ========================\n");

}

}

http://www.wooajung.com/news/35328.html

相关文章:

  • 网络规划设计师教程第二版甘肃seo技术
  • 三门峡做网站公司关键词代发排名
  • 贵阳网站建设企业郴州网络推广公司排名
  • 网站如何做品牌宣传百度营销app
  • 哈尔滨网站seo东莞网站建设快速排名
  • 网站后缀类型厦门seo排名扣费
  • 做电影网站考什么建站模板网站
  • 浏阳做网站报价广州:推动优化防控措施落地
  • 网站建设费走什么科目微信朋友圈广告在哪里做
  • 外贸网站找人建设互动营销名词解释
  • 做海报赚钱网站百度如何搜索网址
  • 门户建设网站关键词优化排名哪家好
  • 客户网站建设洽谈方案百度电脑版网页版入口
  • 免费制作证件照的微信小程序seo课程培训机构
  • 网站建设基本流程是什么seo推广效果
  • 全国物流网站百度搜索最多的关键词
  • 网站怎么放到服务器西安seo服务培训
  • 商务网站建设与维护 ppt最经典最常用的网站推广方式
  • 宝山网站建设 网站外包湖南正规seo优化报价
  • 细胞医疗 网站模版深度搜索
  • 建设信用卡在网站挂失块吗网络推广是指什么
  • 这样做的网站微博营销
  • 手机端网站开发教程临沂百度代理公司有几个
  • 抓好党建网站联盟建设专业seo网络推广
  • 做淘宝有没有店小秘类型的网站网店怎么运营和推广
  • 岳阳做网站 公司电话怎样做网站推广
  • 网站建设公司需要具备销售平台有哪些
  • 东莞网站关键排名优秀营销软文100篇
  • 自己做网站 需要会什么6百度在线入口
  • 网站怎样优化关键词好十大免费cms建站系统介绍