import java.util.Map;
import java.util.concurrent.ConcurrentSkipListMap;

/**
 *  跳表的使用
 */
public class ConcurrentSkipListMapDemo {
    public static void main(String[] args){
        ConcurrentSkipListMap<Integer, Integer> map = new ConcurrentSkipListMap<>();
        for (int i = 0; i < 30; i++) {
            map.put(i,i);
        }
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            System.out.println(entry.getKey());
        }
    }
    //0
    //1
    //2
    //3
    //4
    //5
    //6
    //7
    //8
    //9
    //10
    //11
    //12
    //13
    //14
    //15
    //16
    //17
    //18
    //19
    //20
    //21
    //22
    //23
    //24
    //25
    //26
    //27
    //28
    //29

    //输出是有序的
}

相关文章:

  • 2022-02-06
  • 2021-11-27
  • 2021-06-18
  • 2021-11-28
  • 2021-05-22
  • 2021-06-14
  • 2022-12-23
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2021-05-15
  • 2021-06-04
  • 2021-07-05
  • 2021-07-19
  • 2021-06-14
相关资源
相似解决方案