
笔试题练习
这个人太懒了
程序员修炼者
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
剑指offer之二维数组查找
题目描述 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 python代码如下: # -*- coding:utf-8 -*- class Solution: # array 二维列表 def Find(self, target,...原创 2018-07-24 12:00:05 · 148 阅读 · 0 评论 -
剑指offer笔试题之重建二叉树
1.python代码 # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # 返回构造的TreeNode根节点 ...原创 2018-07-26 22:08:40 · 135 阅读 · 0 评论 -
剑指offer之倒序打印链表
1.python代码 # -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # 返回从尾部到头部的列表值序列,例如[1,2,3] def printListFr...原创 2018-07-26 22:10:08 · 152 阅读 · 0 评论 -
剑指offer之替换空格
python代码 class Solution: # s 源字符串 def replaceSpace(self, s): # write code here re = "" for st in s: if st == " ": re += "%20" ...原创 2018-07-26 22:11:25 · 185 阅读 · 0 评论 -
剑指offer之两个栈完成队列的进出操作
python代码 # -*- coding:utf-8 -*- class Solution: def __init__(self): self.stack1 = [] self.stack2 = [] def push(self, node): # write code here self.st...原创 2018-07-27 22:18:17 · 182 阅读 · 0 评论 -
剑指offer之找出旋转数组中最小的值
python代码 # -*- coding:utf-8 -*- class Solution: def minNumberInRotateArray(self, rotateArray): # write code here if len(rotateArray) == 0: return 0 else: ...原创 2018-07-27 22:45:53 · 165 阅读 · 0 评论 -
笔试题总结
1.inline的作用 为了解决一些频繁调用的小函数大量消耗栈空间(栈内存)的问题,特别的引入了inline修饰符,表示为内联函数。 inline仅是一个对编译器的建议 建议:inline函数的定义放在头文件中 2.constant的作用 1) 修饰成员变量: const定义的常量编译器可以对其进行数据静态类型安全检查。 const修饰指针变量时: (1)只有一个cons...原创 2018-08-21 21:54:17 · 545 阅读 · 0 评论