{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "%pylab inline\n", "import pandas as pd\n", "\n", "import numpy as np\n", "from __future__ import division\n", "import itertools\n", "\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "\n", "import ctypes\n", "\n", "import logging\n", "logger = logging.getLogger()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 面试题3:二维数组中的查找\n", "\n", "**题目**: \n", "在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。 \n", "请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "exam_lib = ctypes.cdll.LoadLibrary(\"test03.so\")\n", "\n", "exam_lib.main()" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "### 面试题4: 替换空格\n", "\n", "**题目**: \n", "请实现一个函数,把字符串中的每个空格替换成\"%20\",例如“We are happy.”,则输出“We%20are%20happy.”。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 面试题5 :从尾到头打印链表\n", "\n", "**题目**: \n", "输入个链表的头结点,从尾到头反过来打印出每个结点的值。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 面试题6 :重建二叉树\n", "\n", "**题目**: \n", "输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如:前序遍历序列{ 1, 2, 4, 7, 3, 5, 6, 8}和中序遍历序列{4, 7, 2, 1, 5, 3, 8,6},重建出下图所示的二叉树并输出它的头结点。" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.10" } }, "nbformat": 4, "nbformat_minor": 0 }