04 2020 档案
摘要:scala学习 包和引入 1.打包方法 1.在文件顶部放置一个Package子句 2.在Package子句后加上一段花括号包起来的代码块 打包 2.嵌套包 Scala提供了一种名为\_root\_的包,这个包不会与任何用户编写的包冲突。每个你能编写的顶层包都被是做\_root\_的成员。 3.引入
阅读全文
摘要:leetcode刷题笔记二十六 、 二十七、 二十八 leetcode刷题笔记二十六 删除排序数组中的重复项 scala版 源地址: "26. 删除排序数组中的重复项" 问题描述: 给定一个排序数组,你需要在 原地 删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。 不要使用额外的
阅读全文
摘要:leetcode刷题笔记二十五 K 个一组翻转链表 Scala版本 源地址: "25. K 个一组翻转链表" 问题描述: 给你一个链表,每 k 个节点一组进行翻转,请你返回翻转后的链表。 k 是一个正整数,它的值小于或等于链表的长度。 如果节点总数不是 k 的整数倍,那么请将最后剩余的节点保持原有顺
阅读全文
摘要:Scala学习笔记 特质 特质是Scala代码复用的基础单元。特质将方法和字段定义封装起来,然后通过将它们混入类的方式来实现复用。但特质不同于类继承,类继承要求每个类都继承自一个明确的超类,而类可以同时混入任意数量的特质。 1.特质 关键字:trait 特质由一个默认的超类 AnyRef 特质定义好
阅读全文
摘要:leetcode刷题笔记二十四 两两交换链表中的节点 Scala版本 源地址: "24. 两两交换链表中的节点" 问题描述: Given a linked list, swap every two adjacent nodes and return its head. You may not mod
阅读全文
摘要:leetcode刷题笔记二十三 合并K个排序链表 Scala版本 源地址: "23. 合并K个排序链表" 问题描述: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its comp
阅读全文
摘要:1.什么是Akka Akka通常是指一个分布式工具集,用于协调远程计算资源来进行一些工作,是Actor开发模型的一种现代化实现。 2.Actor 重要概念与消息传递方式 重要概念 1.Actor:一个表示工作节点的并发原语,同步处理接收到的消息,Actor可以保存并修改内部状态。 2.消息: 用于跨
阅读全文
摘要:SBT的安装对新手来说还是不太友好吗,看了很多帖子,最终参考了https://zhuanlan.zhihu.com/p/82727108提供的方法,这里自己记录一下。 第一步:安装SBT 下载地址:https://www.scala sbt.org/ 下载解压到指定位置,并将解压路径加入环境变量PA
阅读全文
摘要:leetcode刷题笔记二十二 括号生成 Scala版本 源地址: "22. 括号生成" 问题描述: Given n pairs of parentheses, write a function to generate all combinations of well formed parenthe
阅读全文
摘要:leetcode刷题笔记二十一 合并两个有序列表 Scala版本 源地址: "21. 合并两个有序链表" 问题描述: 将两个升序链表合并为一个新的升序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 输入:1 2 4, 1 3 4 输出:1 1 2 3 4 4 代码补充:
阅读全文
摘要:1.Scala类继承关系 2.== 、eq与 equals 关系 1.eq AnyRef 比较引用(地址)是否相等 ne 2.equals AnyVal 比较值是否相等 3.== 对于比较对象不为null,相当于equals 较为常见 对于比较对象为null , 相当于eq 较为少见 3.底类型 N
阅读全文
摘要:1.总述 组合:一个类可以包含另一个类的引用,利用这个被引用的类来帮助他完成任务。 继承:子类与超类的关系 2.抽象类 修饰符abstract 表明该类可以拥有那些没有实现的抽象成员,因为不能直接实例化一个抽象类。 注:一个方法只要没实现,那么它就是抽象的 3.无参方法 无参方法,又可称为空圆括号方
阅读全文
摘要:leetcode刷题笔记二十 有效的括号 Scala版本 源地址: "20. 有效的括号" 问题描述: Given a string containing just the characters , , , , and , determine if the input string is valid
阅读全文
摘要:leetcode刷题笔记十九 删除链表的倒数第N个节点 Scala版本 源地址: "19. 删除链表的倒数第N个节点" 问题描述: Given a linked list, remove the n th node from the end of list and return its head.
阅读全文
摘要:leetcode刷题笔记十八 四数之和 Scala版本 源地址: "18. 四数之和" 问题描述: Given an array of n integers and an integer , are there elements a , b , c , and d in such that a +
阅读全文
摘要:leetcode刷题笔记十七 电话号码的组合 Scala版本 源地址: "17. 电话号码的字母组合" 题目描述: Given a string containing digits from inclusive, return all possible letter combinations tha
阅读全文
摘要:leetcode刷题笔记十六 接近三数之和 Scala版本 源地址: "16. 最接近的三数之和" 问题描述: Given an array of n integers and an integer , find three integers in such that the sum is clos
阅读全文
摘要:leetcode刷题笔记十五 三数之和 Scala版本 源地址:15. 三数之和 问题描述: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all
阅读全文
摘要:leetcode刷题笔记十四 最长公共前缀 Scala版本 源地址:最长公共前缀 问题描述: Write a function to find the longest common prefix string amongst an array of strings. If there is no c
阅读全文
摘要:leetcode刷题笔记十三 罗马数字转数字 Scala版本 源地址:罗马数字转数字 问题描述: oman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V
阅读全文
摘要:leetcode刷题笔记十二 整数转罗马数字 Scala版本 源地址:整数转罗马数字 问题描述: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V
阅读全文
摘要:leetcode刷题笔记十一 盛最多水的容器 Scala版本 源地址:盛最多水的容器 问题描述: Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai).
阅读全文
摘要:leetcode刷题笔记十 正则表达式 Scala版本 源地址:leetcode刷题笔记十 正则表达式 Scala版本 问题描述: Given an input string (s) and a pattern (p), implement regular expression matching w
阅读全文
摘要:leetcode刷题笔记九 回文数 Scala版本 源地址:leetcode刷题笔记九 回文数 Scala版本 问题描述: Determine whether an integer is a palindrome. An integer is a palindrome when it reads t
阅读全文
摘要:leetcode刷题笔记八 字符串转整性 Scala版本 源地址: leetcode刷题笔记八 字符串转整性 Scala版本 问题描述: Only the space character ' ' is considered as whitespace character. Assume we are
阅读全文
摘要:leetcode刷题笔记七 整数反转 Scala版本 源地址:(leetcode刷题笔记七 整数反转 Scala版本)[https://leetcode.com/problems/reverse-integer/submissions/] 问题描述: Given a 32-bit signed in
阅读全文
摘要:leetcode刷题笔记六 Z字型转换 Scala版本 源地址:(leetcode刷题笔记六 Z字型转换 Scala版本)[https://leetcode.com/problems/zigzag-conversion/submissions/] 问题描述: The string "PAYPALIS
阅读全文
摘要:leetcode刷题笔记五 最长回文子串 Scala版本 源地址: leetcode刷题笔记五 最长回文子串 Scala版本 问题描述 Given a string s, find the longest palindromic substring in s. You may assume that
阅读全文
摘要:leetcode刷题笔记三 最长不重复子串 Scala版本 原地址:[https://leetcode.com/problems/longest-substring-without-repeating-characters/]:最长不重复子串 问题描述 题干: Given a string, fin
阅读全文
浙公网安备 33010602011771号