摘要: 一面--2.6 1.介绍你所知道的常用的时间复杂度 2.解释每一个数据结构的意义,在什么场景中使用? 3.每个数据结构查找与插入的时间复杂度 4.讲一个你所熟知的技术? 5.kv存储项目中初始化的耗时? 6.怎么确定每一个桶的最后一个数据? 7.编程题: //5 个 1 - 100 的整数// 输出 阅读全文
posted @ 2023-02-09 12:15 lyjps 阅读(52) 评论(0) 推荐(0)
摘要: 1.回文子串 class Solution { public int countSubstrings(String s) { int res = 0 , n = s.length(); for(int i = 0;i<n;i++){ int l = i, r = i; while(l>=0&&r<n 阅读全文
posted @ 2023-02-05 00:26 lyjps 阅读(13) 评论(0) 推荐(0)
摘要: 1.最小覆盖子串 class Solution { public String minWindow(String s, String t) { HashMap<Character, Integer> map1 = new HashMap<>(); HashMap<Character, Integer 阅读全文
posted @ 2023-02-04 10:35 lyjps 阅读(18) 评论(0) 推荐(0)
摘要: 一面--2023.1.11 1.简述kv存储引擎项目。 2.pmem的使用方式,作为内存还是直接作为存储? 3.表的结构,表的主键的意义? 4.建立的主键索引与普通的索引有什么区别?如何实现的? 5.哈希表的桶的定义是有相同哈希值还是有相同的key? 这里回答的时候有问题,应该是相同的哈希值。 6. 阅读全文
posted @ 2023-02-03 00:45 lyjps 阅读(37) 评论(0) 推荐(0)
摘要: 1.力扣72--编辑距离 class Solution { //典型动态对话问题 public int minDistance(String word1, String word2) { int m = word1.length(), n = word2.length(); int[][] dp = 阅读全文
posted @ 2023-02-02 23:58 lyjps 阅读(18) 评论(0) 推荐(0)
摘要: 1.力扣406--根据身高重建队列 class Solution { //将二维数组按照不同人的身高升序排列,如果身高相同则按照位置降序排列 public int[][] reconstructQueue(int[][] people) { Arrays.sort(people, new Compa 阅读全文
posted @ 2023-02-01 12:14 lyjps 阅读(14) 评论(0) 推荐(0)
摘要: 1.力扣394--字符串解码 class Solution { public String res; public int i; public String decodeString(String s) { res = new String(); int n = s.length(); i = 0; 阅读全文
posted @ 2023-01-28 11:02 lyjps 阅读(24) 评论(0) 推荐(0)
摘要: 1.分布式session问题 在高并发的情况下,每次请求Nginx的负载均衡算法会分配不同的服务器,而我们的session在某一服务器的tomcat中,这样无法维护我们的登陆状态。我们采用redis集中存储的方法来解决此问题。其逻辑为:通过uuid生成值作为cookie值返回给客户端,在后端,我们将 阅读全文
posted @ 2023-01-26 21:54 lyjps 阅读(124) 评论(0) 推荐(0)
摘要: 1.力扣338--比特位计数 class Solution { public int[] countBits(int n) { //关键在于找到递推公式 int[] res = new int[n+1]; for(int i = 1;i<=n;i++){ res[i] = res[i>>1] + ( 阅读全文
posted @ 2023-01-26 21:12 lyjps 阅读(21) 评论(0) 推荐(0)
摘要: 1.力扣122--买卖股票的最佳时机2 class Solution { public int maxProfit(int[] prices) { int n = prices.length; int[][] dp = new int[n][2]; //二维动态规划, dp[0][0] = 0;dp 阅读全文
posted @ 2023-01-25 16:04 lyjps 阅读(18) 评论(0) 推荐(0)