黑马程序员-java之TreeSet,Comparable,Comparator

WinCC ActiveX控件“许可证缺失”故障排查:从注册表修复到系统兼容性全解析 本文深入解析WinCC ActiveX控件报错“未找到许可证信息”的根本原因与解决方案。核心在于系统注册表中控件的设计时许可证密钥丢失或损坏。文章提供了从手动修复注册表、排查64位系统兼容性,到预防性环境部署的全流程专业指南,帮助工程师彻底解决这一常见故障。 阅读详情

-------------android培训、java培训、---------------


TreeSet可以对元素进行排序,缺省是按照自然排序进行排列,即元素必须实现Comparable接口,或者创建TreeSet对象的时候必须指定一个比较器
且元素唯一。
排序的两种方式:
方式一:让元素自身具备比较性,即让元素类实现Comparable接口,覆写compareTo(),这种排序方式是默认排序,也叫自然排序
方式二:当元素自身不具备比较性时,或者所具备的比较性不是实际需要的,这是就需要让集合TreeSet具备比较性,即在创建集合对象的时候指定比较器
当两种都存在时候,用比较器
原理:二叉树结构(左叉值小于右叉值),新元素大于原有元素,则放在叉的右边,小于则放在左边,等于则不存储
实例:存储自定义对象
代码:
package com.itheima;

import java.util.Comparator;
import java.util.Iterator;
import java.util.TreeSet;

class Student implements Comparable{
    private String name;
    private int age;
    Student(String name,int age){
        this.name=name;
        this.age=age;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public int compareTo(Object obj){//先按年龄比较,年龄相同则按名字自然排序
        if(!(obj instanceof Student)){
            throw new RuntimeException(obj.toString()+"不是学生");
        }
        Student stu = (Student)obj;
        //System.out.println(this.name+"---compareTo---"+stu.name);
        if(this.age>stu.age)
            return 1;
        if(this.age==stu.age){
            return this.name.compareTo(stu.name);
        }
        return -1;
    }
}
class myComparator implements Comparator{//先按姓名自然排序,姓名相同则按年龄升序排序
    public int compare(Object o1,Object o2){
        Student s1 = (Student)o1;
        Student s2 = (Student)o2;
        int num = s1.getName().compareTo(s2.getName());
        if(num==0){
            return new Integer(s1.getAge()).compareTo(s2.getAge());
        }
        return num;
    }
}
public class TreeSetDemo {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        TreeSet ts = new TreeSet();//创建TreeSet对象
        TreeSet ts2 = new TreeSet(new myComparator());
        ts.add(new Student("zhangsan",18));//添加元素到对象ts
        ts.add(new Student("lisi",22));
        ts.add(new Student("wangwu",18));
        ts.add(new Student("zhaoliu",19));
        
        ts2.add(new Student("zhangsan",18));//添加元素到ts2
        ts2.add(new Student("lisi",22));
        ts2.add(new Student("wangwu",18));
        ts2.add(new Student("zhaoliu",19));
        ts2.add(new Student("wangwu",23));
        Iterator it = ts.iterator();
        Iterator it2 = ts2.iterator();
        System.out.println("----------ts中的元素------------");
        while(it.hasNext()){
            Student stu = (Student)it.next();
            System.out.println(stu.getName()+"---"+stu.getAge());
        }
        System.out.println("----------ts2中的元素------------");
        while(it2.hasNext()){
            Student stu2 = (Student)it2.next();
            System.out.println(stu2.getName()+"---"+stu2.getAge());
        }
    }

}


redhawk-sc(seascape)学习日志2 design view是主view,是所有seascape view中最root的部分,一个design view可以驱动多种类型分析比如静态IR drop,动态IR drop以及EM.这些分析可以在不同的PVT和翻转率下.Design view是一个必须的view对于redhawk中的任何类型分析来说。seascape view相当于一个容器,用于保存各种和设计相关的数据,类似于逻辑信息、物理信息等等,每个view都有其对应的输入件和依赖,这些view都是redhawk用于各种类型的分析所需。 阅读详情

相关推荐

解构LOL数值平衡:从基础公式到实战决策的深层逻辑

本文深入解析了《英雄联盟》数值平衡的底层逻辑,从基础攻击力公式到经济系统设计,揭示了MOBA游戏背后的精密数学架构。通过实战案例展示护甲减伤、技能伤害建模等核心机制,探讨装备定价与战斗节奏的数值关联,帮助玩家理解版本更新中的平衡艺术。

weixin_42540248的博客 354

黑马程序员--07.集合框架--08.【TreeSet的Comparator排序】【TreeSet总结】

集合框架--7       TreeSet的Comparator排序    TreeSet总结 ----------- android培训、java培训、java学习型技术博客、期待与您交流! ------------ 1.    TreeSet的Comparator排序 1). Comparator应用的背景 如果对象元素不具有比较性 (就是存入集合的元素所在的类本身没有实现Compa

歆明正航的专栏 1648

Pytorch transformers tokenizer 分词器词汇表添加新的词语和embedding

NLP添加新词汇

7326

黑马程序员-Set-HashSet-TreeSet-Comparator-Comparable

l Set 特点: 1. 无序(存储和查询的顺序不同,因为是按照对象的地址值存储进去的)。 2. 不可重复。   通过查看API,Set的功能与Collection是一样的。   常用子类 1. HashSet 2. TreeSet   l HashSet HashSet如何保证元素的唯一性? 原理:将对象存储在HashTable中,HashTable是通过该对象自己的H

liuxiaohui_dh的专栏 1266

Honeywell EPKS 核心功能块组态与执行调度实战解析

本文深入解析Honeywell EPKS系统的核心功能块组态与执行调度技术,涵盖控制模块(CM)、顺序控制模块(SCM)和输入输出模块(IOM)的配置方法。通过实战案例分享执行顺序(ORDERINCM)和CEE执行周期的优化策略,帮助工程师提升工业自动化系统的控制精度和运行效率。

weixin_28724319的博客 419

Cadence IC618与Spectre231安装配置全攻略:License、环境变量与依赖检查

EDA工具部署中,License管理与环境变量隔离是核心难点。FlexLM作为通用授权机制,通过守护进程和端口配置实现工具授权;环境变量则控制工具路径与库加载顺序,避免版本冲突。合理配置可确保IC618与Spectre231稳定运行,提升仿真效率。典型应用场景包括模拟IC设计、高校实验室及企业级EDA环境。本文聚焦Cadence IC618与Spectre231的安装实践,详解License配置、环境隔离及依赖检查,助你快速搭建可靠设计环境。

weixin_28721917的博客 338

黑马程序员——TreeSet排序

TreeSet是集合类Set的一种,可以对Set集合中元素进行排序,TreeSet中元素同样是无序的,即存入和取出的顺序不一定一致,元素不可重复,TreeSet中的对象必须具备比较性,元素不可重复,保证元素唯一性的依据是compareTo方法和return 0。 TreeSet存储对象的时候, 可以排序, 但是需要指定排序的算法,Integer能排序(有默认顺序), String能排序(有默认顺

hpu186的专栏 647

杂货店商品数据集挖掘关联规则实验

(2)选择事务集中前100条事务,选择合适的支持度阈值,使用Apriori算法和FP-growth算法挖掘频繁项集(推荐使用mlxtend包的apriori和fpgrowth函数),并对比apriori算法和fpgrowth算法的时间复杂度;(比如用户1000在2015年3月15日对应的事务为{‘sausage’,’whole milk’,’semi-finished bread’,’yogurt’}),然后按照用户ID递增,时间递增的方式对事务进行排序;7. 排版工整自洽,图表标题准确(10分)

m0_62500122的博客 1445

黑马程序员——java基础笔记:比较器Comparator和Comparable

——Java培训、Android培训、iOS培训、.Net培训、期待与您交流! ——-比较器概述: 如果一个数组里放的是一组对象,那么就会有怎么把这些对象进行排序的问题,往容器TreeSet里面添加对象时,必须要求这些对象时能够进行比较的,这里也会有对象的排序问题。我们在对对象进行排序的时候,就会用到比较器。常用的比较器有两种,Comparable和Comparator。 Comparable和C

Luffyworld的博客 480

2023东华大学机试OJ进阶版1-81题

先排序。每次找两个最小的数,把其中一个置为两数之和,并累加这个和值,另一个数置为-1,然后再排序,重复操作,直到只剩下一个数。105。

m0_49263811的博客 2800

用 CORRESPONDING #( ) 优雅复制同名字段:从 MOVE-CORRESPONDING 到现代 ABAP 结构映射的关键差异与最佳实践

摘要:本文深入探讨了SAP ABAP中结构数据复制的两种主要方式——传统MOVE-CORRESPONDING与现代CORRESPONDING #()的核心差异。重点分析了现代构造表达式会初始化目标结构的关键特性,通过SAP_GWFND开发中的实际案例展示了这一差异可能引发的线上问题。同时介绍了使用BASE保留目标字段值的技巧,以及通过MAPPING处理字段名不一致的场景。文章为ABAP开发者提供了在S/4HANA、BTP及RAP等现代架构下的数据映射最佳实践,帮助规避常见的维护陷阱。(149字)

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 2266

黑马程序员------TreeSet集合框架存储自定义元素之排序Comparable与Comparator

------- android培训、java培训、期待与您交流! ---------- TreeSet集合框架存储自定义元素之排序Comparable与Comparator 我们知道,往TreeSet中存入的元素是要具有比较行的,TreeSet是要默认为元素排序的,但是我们如果存储的元素对象自身不具备比较性怎么办?有两种方式来解决这个问题,就要用到Comparable与Comparator

aurora_bessie 501

手把手教程 | 使用 apktool 修改已发布 APK 的版本号与版本名称

摘要:本文介绍如何使用apktool工具直接修改APK版本信息,适用于版本回滚、多版本测试等场景。详细步骤包括反编译APK、修改版本号、重打包、对齐优化和重新签名,并分享了反编译相关实用知识。该方法无需源代码参与,但需注意修改后的APK必须重新签名才能安装。最后强调应在合法范围内使用反编译技术。

学无止境 847

黑马程序员对TreeSet集合中的元素排序的两种方式

------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! ------- TreeSet对元素进行排序的方式一:让元素自身具有比较功能,元素需要实现Comparable接口,覆盖compareTo方法 package org.blog.test2; import java.util.TreeSet; class Person implements Compar

w12340031的专栏 707

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

黑马程序员——java集合中的TreeSet

---------------------- ASP.Net+Android+IOS开发、.Net培训、期待与您交流! ---------------------- 1.        java集合框架中的Set接口: Java的集合类主要由两个接口派生而出:Collection和Map. Collection接口派生出了两个重要的子接口:List、Set; 在实现Set接口中的子类中有两

xyyancsd的专栏 640

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

黑马程序员训练营---------TreeSet集合中对象进行排序的两种方式

---------------------------  中关村黑马程序员训练营 --------------------------------                                                TreeSet集合中对象进行排序的两种方式 .------http://www.itheima.com" target="blank">Java培训、An

FMFsunshine的专栏 765

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

黑马程序员—基础-TreeSet的使用

/* TreeSet:它可以给Set集合中的元素进行指定方式的排序。         保证元素唯一性的方式:通过比较的结果是否为0.         底层数据结构是:二叉树。 */ import java.util.*; class TreeSetDemo2   {     public static void main(String[] args)

qq_25418233的博客 327

黑马程序员——java基础——Java集合中TreeSet实现元素唯一性的方法

Java集合中TreeSet实现元素唯一性的方法

hutaoxiaodai的博客 505

黑马程序员——Comparable接口和Comparactor接口的使用以及分析

大纲:本篇博客主要对Comparable接口、Comparactor接口和Arrays.sort()、Collections.sort()方法的学习使用进行介绍,是因为做基础测试题和答题才知道这两个接口,题目已经提交,但是对两个接口的详细使用和区别却是一知半解,只是感觉它们有点类似,就抽出时间搞清楚,下面是学习的

十指空间 960

黑马程序员17-6:TreeSet的Comparator比较器接口以及compareTo优化写法

[align=center]------- [url=http://edu.csdn.net/heima]android培训 [/url]、[url=http://edu.csdn.net/heima]java培训[/url]、期待与您交流!------- [/align] [code="java"] package cn.itcast.p.bean; import ja...

kingdelee的专栏 567

黑马程序员---TreeSet

ThreeSet能够对集合中的对象排序,当TreeSet想集合中加入一个对象时,会把它插入到有序的对象序列中。那么TreeSet是如何排序呢?TreeSet支持两种排序方式:自然排序和客户化排序.在默认情况下TreeSet采用自然排序方式。     先来介绍介绍什么是自然排序吧   1、自然排序    在JDK类库中,有一部分类实现了Comparable接口,如Integer Doubl

李靖黑马学习的专栏 653

黑马程序员_日记54_TreeSet使用比较器和泛型的初级结合

——- android培训、java培训、期待与您交流! ———-查阅API,得到: “TreeSet(Comparator六、比较器的泛型定义方式分析import java.util.*; class GenericDemo6 { public static void main(String[] args) { //方式二和方式一选其一,打开对于的代码块就可以了

itheima_1llt的专栏 368

TreeSet集合

不可以存储重复元素没有索引可以将元素按照规则进行排序TreeSet():根据其元素的自然排序进行排序TreeSet(Comparator comparator) :根据指定的比较器进行排序两种比较方式小结自然排序: 自定义类实现Comparable接口,重写compareTo方法,根据返回值进行排序比较器排序: 创建TreeSet对象的时候传递Comparator的实现类对象,重写compare方法,根据返回值进行排序。

summer__7777的博客 105

黑马程序员_Java第15天知识总结_TreeSet_泛型

------- android培训、java培训、期待与您交流! ---------- 今天学习的知识点: HashSet_TreeSet_Comparable和其方法_Comparator_和其方法_泛型_泛型定义在类上_泛型定义在方法上_泛型定义在静态方法上 泛型定义在接口上_泛型的上限_泛型的下限_泛型的通配符(占位符) Set:无序,不可以重复元素。 |--HashSet

v191211的专栏 636

黑马程序员_Java集合总结(二)

---------------------- android培训、java培训、期待与您交流! ---------------------- 一、set(集)            特点;里面的数据不能有重复  储存的顺序不能确定  索引不能访问其中具体数据

zwq5337的专栏 298

黑马程序员--java集合TreeSet

-------android培训、java培训、期待与您交流!     ----------  »知识点总结 1.TreeSet:可以对Set集合中的元素进行排序。  底层数据结构是二叉树。  保证元素唯一性的依据: compareTo方法return 0. 2. TreeSet排序的第一种方式:让元素自身具备比较性。  元素需要实现Comparable接口,覆盖compare

w1h2b1111的专栏 635
上一篇: 黑马程序员-Java之HashSet
下一篇: 黑马程序员-java之HashMap,TreeMap
forTomorrow_java
博客等级 码龄12年 0粉丝 14原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址