摘要: SBT的安装对新手来说还是不太友好吗,看了很多帖子,最终参考了https://zhuanlan.zhihu.com/p/82727108提供的方法,这里自己记录一下。 第一步:安装SBT 下载地址:https://www.scala sbt.org/ 下载解压到指定位置,并将解压路径加入环境变量PA 阅读全文
posted @ 2020-04-21 20:30 ganshuoos 阅读(316) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记二十二 括号生成 Scala版本 源地址: "22. 括号生成" 问题描述: Given n pairs of parentheses, write a function to generate all combinations of well formed parenthe 阅读全文
posted @ 2020-04-20 22:59 ganshuoos 阅读(115) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记二十一 合并两个有序列表 Scala版本 源地址: "21. 合并两个有序链表" 问题描述: 将两个升序链表合并为一个新的升序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 输入:1 2 4, 1 3 4 输出:1 1 2 3 4 4 代码补充: 阅读全文
posted @ 2020-04-20 22:31 ganshuoos 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1.Scala类继承关系 2.== 、eq与 equals 关系 1.eq AnyRef 比较引用(地址)是否相等 ne 2.equals AnyVal 比较值是否相等 3.== 对于比较对象不为null,相当于equals 较为常见 对于比较对象为null , 相当于eq 较为少见 3.底类型 N 阅读全文
posted @ 2020-04-20 19:13 ganshuoos 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1.总述 组合:一个类可以包含另一个类的引用,利用这个被引用的类来帮助他完成任务。 继承:子类与超类的关系 2.抽象类 修饰符abstract 表明该类可以拥有那些没有实现的抽象成员,因为不能直接实例化一个抽象类。 注:一个方法只要没实现,那么它就是抽象的 3.无参方法 无参方法,又可称为空圆括号方 阅读全文
posted @ 2020-04-20 16:20 ganshuoos 阅读(128) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记二十 有效的括号 Scala版本 源地址: "20. 有效的括号" 问题描述: Given a string containing just the characters , , , , and , determine if the input string is valid 阅读全文
posted @ 2020-04-19 22:25 ganshuoos 阅读(129) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记十九 删除链表的倒数第N个节点 Scala版本 源地址: "19. 删除链表的倒数第N个节点" 问题描述: Given a linked list, remove the n th node from the end of list and return its head. 阅读全文
posted @ 2020-04-19 22:17 ganshuoos 阅读(100) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记十八 四数之和 Scala版本 源地址: "18. 四数之和" 问题描述: Given an array of n integers and an integer , are there elements a , b , c , and d in such that a + 阅读全文
posted @ 2020-04-18 21:47 ganshuoos 阅读(113) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记十七 电话号码的组合 Scala版本 源地址: "17. 电话号码的字母组合" 题目描述: Given a string containing digits from inclusive, return all possible letter combinations tha 阅读全文
posted @ 2020-04-18 21:30 ganshuoos 阅读(170) 评论(0) 推荐(0) 编辑
摘要: leetcode刷题笔记十六 接近三数之和 Scala版本 源地址: "16. 最接近的三数之和" 问题描述: Given an array of n integers and an integer , find three integers in such that the sum is clos 阅读全文
posted @ 2020-04-16 21:33 ganshuoos 阅读(127) 评论(0) 推荐(0) 编辑