- 博客(12)
- 收藏
- 关注
原创 Spark 详解
Spark 详解参考书籍Scala 参考书籍 《Spark 编程基础》(Scala版) 《Spark 快速大数据分析》 《Spark 高级数据分析》 Scala 变量: val 变量名(:数据类型) = 初始值 var 变量名(:数据类型) = 初始值 val 声明的变量,在声明时必须被初始化,并且初始化后就不能再赋新的值; var 声明的变量,是可变的,可以被多次赋值。 Scala提供一种类型推断机制(Type Inference),它会根据初始值自动推断变量的类型。 以下等效: var str =
2021-03-28 20:57:35
244
原创 链表(六)----力扣(合并两个有序链表)
链表(六)----力扣(合并两个有序链表) 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 https://leetcode.com/problems/merge-two-sorted-lists // 不要提交这个类 public static class ListNode { public int val; public ListNode next; ListNode() {}
2021-03-28 20:49:36
121
原创 2021-03-28
链表(五)— 力扣(两数相加) 给你两个 非空 的链表,表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的,并且每个节点只能存储 一位 数字。 请你将两个数相加,并以相同形式返回一个表示和的链表。 你可以假设除了数字 0 之外,这两个数都不会以 0 开头。 https://leetcode-cn.com/problems/add-two-numbers/ public class ListNode { int val; ListNode next;
2021-03-28 20:43:23
98
原创 2021-03-28
链表(四)— K个节点的组内逆序调整 测试链接:https://leetcode.com/problems/reverse-nodes-in-k-group/ public class ListNode { int val; ListNode next; ListNode() {} ListNode(int val) { this.val = val; } ListNode(int val, Lis
2021-03-28 20:36:59
98
原创 2021-03-28
链表(三)— 用双链表实现双端队列 对数器来自左神 public static class Node<V>{ private V value; Node<V> last; Node<V> next; public Node(V value) { this.value = value; this.last = null; this
2021-03-28 20:35:14
66
原创 2021-03-28
链表(二)— 用单链表实现队列结构和堆结构 对数器来自左神 public static class Node<V>{ private V value; public Node<V> next; public Node(V value) { this.value = value; this.next = null; } } public stati
2021-03-28 20:33:34
74
原创 2021-03-28
链表(一)—单(双)链表反转 对数器来自左神 public static class Node{ private int value; public Node next; public Node(int value) { this.value = value; } } public static class DoubleNode{ private int value;
2021-03-28 20:31:19
125
原创 2021-03-02
二分法(四) 无序也能二分–局部最小值问题 public class Code04_BSAwesome { public static int oneMinIndex(int[] arr){ int N = arr.length; if (arr == null || N == 0){ return -1; } if (N == 1){ return 0; }
2021-03-02 21:16:50
139
原创 2021-03-02
二分法(三) 有序数组中找到<=num最右的位置 public class Code03_BSNearRight { public static int nearestIndex(int[] arr,int num){ int N = arr.length; if (arr == null || N == 0){ return -1; } int L = 0; int R = N-1;
2021-03-02 21:15:18
81
原创 2021-03-02
二分法(二) 有序数组中找到>=num最左的位置 public class Code02_BSNearLeft { public static int mostLeftNoLessNumIndex(int[] arr,int num){ if (arr == null || arr.length == 0){ return -1; } int L = 0; int R = arr.length - 1;
2021-03-02 21:14:16
109
原创 2021-03-02
二分法(一) 有序数组中找到num public class Code01_BSExist { public static Boolean findNumIndex(int[] arr,int num){ if (arr == null || arr.length == 0){ return false; } int L = 0; int R = arr.length - 1; while (L
2021-03-02 21:12:51
74
原创 随机盒子
随机盒子 已知[a,b]等概率随机 求[c,d]随机(不能用随机函数) //随机盒子: //从a~b随机到c~d随机 public static int a; public static int b; public static int c; public static int d; public static int RandomBox(int a,int b,int c,int d){ return g4() + c; } public static int g1(){ retu
2021-02-28 21:19:23
296
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人