摘要: Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linea 阅读全文
posted @ 2021-12-14 22:04 啤酒加点醋 阅读(26) 评论(0) 推荐(0)
摘要: 给定一个整数数组,判断是否存在重复元素。 如果存在一值在数组中出现至少两次,函数返回 true 。如果数组中每个元素都不相同,则返回 false 。 题解一:双循环 class Solution { public boolean containsDuplicate(int[] nums) { for 阅读全文
posted @ 2021-12-12 15:31 啤酒加点醋 阅读(29) 评论(0) 推荐(0)
摘要: /* 带有哨兵的链表。哨兵所在的位置是真正列表开始前的一位。记住这一点,即可轻松理解哨兵含义,并编写addFirst和addLast方法。*/ // first是否为空影响某些情况的判断,既然这样,找一个哨兵,指向first。就可解决这一问题。这个思路很好。 public class SLList_ 阅读全文
posted @ 2021-12-09 19:05 啤酒加点醋 阅读(89) 评论(0) 推荐(0)
摘要: 简单的List功能实现,v1 public class SLList_1{ public static class IntNode{ public int item; public IntNode next; public IntNode(int i, IntNode n){ item = i; n 阅读全文
posted @ 2021-12-08 12:11 啤酒加点醋 阅读(37) 评论(0) 推荐(0)
摘要: 1. .*转 .eps bmeps -c img.png img.eps 阅读全文
posted @ 2021-12-08 12:03 啤酒加点醋 阅读(10) 评论(0) 推荐(0)