
程序员面试金典
码不停Ti
信息安全在校大学生
展开
-
【LeetCode程序员面试金典】面试题 08.11. Coin LCCI
Given an infinite number of quarters (25 cents), dimes (10 cents), nickels (5 cents), and pennies (1 cent), write code to calculate the number of ways of representing n cents.(The result may be large, so you should return it modulo 1000000007)Example1:.原创 2020-05-22 11:07:32 · 508 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.04. Palindrome Permutation LCCI
Given a string, write a function to check if it is a permutation of a palin drome. A palindrome is a word or phrase that is the same forwards and backwards. A permutation is a rearrangement of letters. The palindrome does not need to be limited to just di原创 2020-05-22 10:33:29 · 453 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 02.03. Delete Middle Node LCCI
Implement an algorithm to delete a node in the middle (i.e., any node but the first and last node, not necessarily the exact middle) of a singly linked list, given only access to that node.Example:Input: the node c from the linked list a->b->c.原创 2020-05-17 00:04:33 · 447 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 02.02. Kth Node From End of List LCCI
Implement an algorithm to find the kth to last element of a singly linked list.Return the value of the element.Note: This problem is slightly different from the original one in the book.Example:Input: 1->2->3->4->5 和 k = 2Output: 4No...原创 2020-05-17 00:01:35 · 421 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.07. Rotate Matrix LCCI
Given an image represented by an N x N matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place?Example 1:Given matrix =[ [1,2,3], [4,5,6], [7,8,9]],Rotate the matrix in ...原创 2020-05-13 09:07:04 · 566 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.06. Compress String LCCI
Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the "compressed" string would not become smaller than the original string, your method should retu原创 2020-05-13 08:47:04 · 459 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 10.01. Sorted Merge LCCI
You are given two sorted arrays, A and B, where A has a large enough buffer at the end to hold B. Write a method to merge B into A in sorted order.Initially the number of elements in A and B aremandn respectively.Example:Input:A = [1,2,3,0,0,0], ...原创 2020-05-13 08:34:52 · 462 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 16.01. Swap Numbers LCCI
Write a function to swap a number in place (that is, without temporary vari ables).Example:Input: numbers = [1,2]Output: [2,1]Note:numbers.length == 2来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/swap-numbers-lcci著作权归领扣网络所有。商业转载请联系官方授权,非商原创 2020-05-12 22:09:33 · 551 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.09. String Rotation LCCI
Given two strings, s1and s2, write code to check if s2 is a rotation of s1 (e.g.,"waterbottle" is a rotation of"erbottlewat").Can you useonly one call to the method thatchecks if one word is a substring of another?Example 1:Input: s1 = "waterbottle...原创 2020-05-12 21:54:06 · 493 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.02. Check Permutation LCCI
Given two strings,write a method to decide if one is a permutation of the other.Example 1:Input: s1 = "abc", s2 = "bca"Output: trueExample 2:Input: s1 = "abc", s2 = "bad"Output: falseNote:0 <= len(s1) <= 1000 <= len(s2) <= 100来源:原创 2020-05-12 21:43:08 · 476 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.05. One Away LCCI
There are three types of edits that can be performed on strings: insert a character, remove a character, or replace a character. Given two strings, write a function to check if they are one edit (or zero edits) away.Example1:Input:first = "pale"...原创 2020-05-11 15:35:22 · 526 阅读 · 0 评论 -
【LeetCode程序员面试金典】面试题 01.01. Is Unique LCCI
Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?Example 1:Input: s = "leetcode"Output: falseExample 2:Input: s = "abc"Output: true来源:力扣(LeetCode)链接:https://leetcode-cn原创 2020-05-11 14:36:39 · 618 阅读 · 0 评论 -
必备核心数据结构和算法清单
今天看了一下程序员面试金典那本书,第七章里面列举了程序员必备的核心数据结构和算法清单数据结构链表 树 单词查找树 图 栈和队列 堆 向量 数组列表 散列表算法广度优先搜索 深度优先搜索 二分查找 归并排序 快排概念位操作 内存 堆栈 递归 动态规划 大O时间及空间根据这个最基础的清单 我来填补一下自己知识点的空缺吧。...原创 2020-04-02 14:40:16 · 639 阅读 · 0 评论