数据结构与算法题整理

排序

    /**
     * 插入排序
     * 
     * @param arr
     */
    public static void insertSort(int arr[]) {
        for (int i = 1; i < arr.length; i++) {
            int temp = arr[i];
            int j = i;
            while (j > 0 && temp < arr[j - 1]) {
                arr[j] = arr[j - 1];
                j--;
            }
            arr[j] = temp;
        }
    }

    /**
     * 冒泡排序
     * 
     * @param array
     */
    public static void bubbleSort(int array[]) {
        if (array == null || array.length == 0) {
            return;
        }
        for (int i = 0; i < array.length - 1; i++) {// 执行n-1趟
            boolean flag = false;// 标志位,判断这一趟排序是否有交换位置
            for (int j = 0; j < array.length - 1 - i; j++) {
                if (array[j] > array[j + 1]) {
                    // 利用异或的自反性交换值
                    array[j] = array[j] ^ array[j + 1];
                    array[j + 1] = array[j] ^ array[j + 1];
                    array[j] = array[j] ^ array[j + 1];
                    flag = true;
                }
            }
            if (!flag) {
                break;
            }
        }

    }

    /**
     * 简单选择排序
     * 
     * @param array
     */
    public static void selectSort(int array[]) {
        int len = array.length;
        for (int i = 0; i < len - 1; i++) {
            int min = i;
            for (int j = i + 1; j < len; j++) {
                if (array[j] < array[min]) {
                    min = j;
                }
            }
            // 交换
            if (min != i) {
                int temp = array[i];
                array[i] = array[min];
                array[min] = temp;
            }
        }
    }

    /**
     * 堆排序
     * 
     * @param array
     */
    public static void heapSort(int array[]) {

        createHeap(array);
        for (int i = array.length - 1; i > 0; i--) {
            // 交换
            int temp = array[0];
            array[0] = array[i];
            array[i] = temp;
            adjustHeap(array, 0, i);// 调整前面剩下的i个元素,后面的元素不要动
        }
    }

    // 建初堆
    public static void createHeap(int array[]) {
        for (int i = array.length / 2; i >= 0; i--) {// 从最后一个非终端结点开始
            adjustHeap(array, i, array.length);
        }
    }

    // 调整堆
    public static void adjustHeap(int array[], int parentNode, int maxSize) {
        int leftChildNode = (parentNode << 1) + 1;// 位运算效率更高
        int rightChildNode = (parentNode << 1) + 2;
        int maxNode = parentNode;
        // 选出三个之中最大值的下标
        if (leftChildNode < maxSize && array[parentNode] < array[leftChildNode]) {// 有左孩子结点(且此孩子结点在未排序的范围内)
            maxNode = leftChildNode;
        }
        if (rightChildNode < maxSize && array[maxNode] < array[rightChildNode]) {// 有右孩子结点
            maxNode = rightChildNode;
        }
        if (maxNode != parentNode) {
            // 交换
            array[maxNode] = array[maxNode] ^ array[parentNode];
            array[parentNode] = array[maxNode] ^ array[parentNode];
            array[maxNode] = array[maxNode] ^ array[parentNode];

            adjustHeap(array, maxNode, maxSize);// 重新调整孩子结点所在树为大根堆
        }

    }

    /**
     * 快速排序
     * 
     * @param array
     * @param low
     * @param high
     */
    public static void quickSort(int array[], int low, int high) {
        if (low < high) {// 长度大于1
            int p = partition(array, low, high);
            quickSort(array, low, p - 1);
            quickSort(array, p + 1, high);
        }
    }

    // 每一趟排序确定此数组第一个数的最终位置,并返回下标
    public static int partition(int array[], int low, int high) {
        int key = array[low];// 取次数组第一个数为枢轴
        while (low < high) {
            while (low < high && array[high] >= key) {
                high--;
            }
            array[low] = array[high];
            while (low < high && array[low] <= key) {
                low++;
            }
            array[high] = array[low];
        }
        array[low] = key;
        return low;

    }
}

查找


    /**
     * 二分查找 非递归
     * 
     * @param array
     * @param tar
     * @return
     */
    public static int binSearch(int array[], int tar) {
        int len = array.length;
        int low = 0;
        int high = len - 1;
        while (low <= high) {

            int mid = (low + high) / 2;
            if (array[mid] == tar) {
                return mid;
            } else if (array[mid] > tar) {
                high = mid - 1;
            } else {
                low = mid + 1;
            }
        }
        return -1;
    }

    /**
     * 二分查找 递归
     * 
     * @param array
     * @param tar
     * @param low
     * @param high
     * @return
     */
    public static int binSearch(int array[], int tar, int low, int high) {
        if (low > high) {
            return -1;
        }
        int mid = (low + high) / 2;
        if (array[mid] == tar) {
            return mid;
        } else if (array[mid] > tar) {
            return binSearch(array, tar, low, mid - 1);
        } else {
            return binSearch(array, tar, mid + 1, high);
        }
    }

动态规划

    /**
     * 01背包
     * 
     * @param v
     * @param w
     * @param W
     * @return
     */
    public static int knapsack(int v[], int w[], int W) {
        int row = v.length;
        int c[][] = new int[row + 1][W + 1];// c[i][j]选择前i个物品放入质量为j的背包的最大价值
        for (int i = 0; i <= row; i++) {
            c[i][0] = 0;
        }
        for (int i = 0; i <= W; i++) {
            c[0][i] = 0;
        }
        for (int i = 1; i <= row; i++) {
            for (int j = 1; j <= W; j++) {
                if (w[i] > j) {
                    c[i][j] = c[i - 1][j];
                } else {
                    c[i][j] = c[i - 1][j] > v[i] + c[i - 1][j - w[i]] ? c[i - 1][j]
                            : v[i] + c[i - 1][j - w[i]];
                }
            }
        }
        return c[row][W];
    }

    /**
     * 格子取数/走棋盘问题
     * 问题描述:给定一个m*n的矩阵,每个位置是一个非负整数,从左上角开始放一个机器人,它每次只能朝右和下走,走到右下角,求机器人的所有路径中
     * ,总和最小的那条路径
     * 
     * @param array
     *            原始棋盘数组
     * @return 最小总和
     */
    public static int minPath(int[][] array) {
        if (array == null || array.length == 0) {
            return 0;
        }
        int row = array.length;
        int col = array[0].length;
        int[][] dp = new int[row][col];
        dp[0][0] = array[0][0];
        for (int i = 1; i < row; i++) {
            dp[i][0] = dp[i - 1][0] + array[i][0];
        }
        for (int i = 1; i < col; i++) {
            dp[0][i] = dp[0][i - 1] + array[0][i];
        }
        for (int i = 1; i < row; i++) {
            for (int j = 1; j < col; j++) {
                dp[i][j] = (dp[i - 1][j] < dp[i][j - 1] ? dp[i - 1][j]
                        : dp[i][j - 1]) + array[i][j];
            }
        }
        return dp[row - 1][col - 1];
    }

    /**
     * 最长单调递增子序列
     * 问题描述:给定长度为N的数组A,计算A的最长单调递增的子序列(不一定连续)。如给定数组A{5,6,7,1,2,8},则A的LIS为
     * {5,6,7,8},长度为4.
     * 
     * @param array
     *            原始序列
     * @return 最大长度
     */
    public static int LIS(int array[]) {

        if (array == null || array.length == 0) {
            return 0;
        }
        int len = array.length;
        int b[] = new int[len];// b[i]表示以下标i元素结束的 最长单调递增子序列的长度
        Stack<Integer> stack = new Stack<Integer>();
        int pre[] = new int[len]; // 前驱元素数组,记录当前以该元素作为最大元素的递增序列中该元素的前驱节点,用于打印序列用
        for (int i = 0; i < len; i++) {
            pre[i] = i;
        }

        int maxLen = 1;
        int index = 0;
        b[0] = 1;
        for (int i = 1; i < len; i++) {
            int max = 0;
            for (int j = 0; j < i; j++) {
                if (array[j] < array[i] && max < b[j]) {
                    max = b[j];
                    pre[i] = j;
                }
            }
            b[i] = max + 1;
            // 得到当前最长递增子序列的长度,以及该子序列的最末元素的位置
            if (maxLen < b[i]) {
                maxLen = b[i];
                index = i;
            }
        }
        // 输出序列
        while (pre[index] != index) {
            stack.add(array[index]);
            index = pre[index];
        }
        stack.add(array[index]);
        while (!stack.empty()) {
            System.out.println("s=" + stack.pop());
        }
        return maxLen;
    }
}

回溯

/**
 * @author Allen Lin
 * @date 2016-8-17
 * @desc 回溯法求01背包,复杂度O(n*n^2)。用动态规划更好,O(n*C),C为背包容量
 */
public class HuiShuo {
    static int n;// 物品数量
    static int w[], v[];// 物品的重量,价值
    static int s;// 包的容量
    static int x[];// 暂时选中情况
    static int bestx[];// 最好的选中情况
    static int maxv;// 最大的价值

    public static void main(String[] arg) {
        n = 4;
        w = new int[] { 0, 7, 3, 4, 5 };
        v = new int[] { 0, 42, 12, 40, 25 };
        s = 10;
        x = new int[n + 1];
        bestx = new int[n + 1];
        backTrack(1, 0, 0);
        for (int j = 1; j <= n; j++) {
            if (bestx[j] == 1) {
                System.out.println(v[j] + " ");
            }
        }
        System.out.println("maxv" + maxv);
    }

    private static void backTrack(int i, int cv, int cw) {
        if (i > n) {
            if (cv > maxv) {
                maxv = cv;
                for (int j = 1; j <= n; j++) {
                    bestx[j] = x[j];
                }
            }
        } else {
            // 左子树
            if (cw + w[i] <= s) {
                x[i] = 1;
                cw += w[i];
                cv += v[i];
                backTrack(i + 1, cv, cw);
                cw -= w[i];
                cv -= v[i];
            }
            // 右子树
            if (bound(i + 1, cv, cw) > maxv) {
                x[i] = 0;
                backTrack(i + 1, cv, cw);
            }
        }
    }

    // 上界函数
    private static int bound(int i, int cv, int cw) {

        int b = cv;
        int left_w = s - cw;
        while (i <= n && left_w >= w[i]) {
            left_w -= w[i];
            b += v[i];
            i++;
        }
        // 装满背包
        if (i <= n) {
            b += v[i] / w[i] * left_w;
        }
        return b;
    }
}

数据结构相关


    /**
     * 题目描述 :输入一个链表,从尾到头打印链表每个节点的值。
     * 
     * 输入描述: 输入为链表的表头
     * 
     * 输出描述: 输出为需要打印的“新链表”的表头
     * 
     */
    class ListNode {
        int val;
        ListNode next = null;

        ListNode(int val) {
            this.val = val;
        }
    }

    // 递归实现

    ArrayList<Integer> arrayList = new ArrayList<Integer>();

    public ArrayList<Integer> printListFromTailToHead(ListNode listNode) {
        if (listNode != null) {
            printListFromTailToHead(listNode.next);
            arrayList.add(listNode.val);
        }
        return arrayList;
    }

    /*
     * 重建二叉树
     * 
     * 题目描述
     * 
     * 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7
     * ,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。
     */
    class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public TreeNode reConstructBinaryTree(int[] pre, int[] in) {
        TreeNode root = reConstructBinaryTree(pre, 0, pre.length - 1, in, 0,
                in.length - 1);
        return root;

    }

    private TreeNode reConstructBinaryTree(int[] pre, int startPre, int endPre,
            int[] in, int startIn, int endIn) {

        if (startPre > endPre || startIn > endIn)
            return null;
        TreeNode root = new TreeNode(pre[startPre]);

        for (int i = startIn; i <= endIn; i++)
            if (in[i] == pre[startPre]) {
                root.left = reConstructBinaryTree(pre, startPre + 1, startPre
                        + i - startIn, in, startIn, i - 1);
                root.right = reConstructBinaryTree(pre, i - startIn + startPre
                        + 1, endPre, in, i + 1, endIn);
            }

        return root;
    }

    /**
     * 
     * 二叉树的镜像
     * 
     * 操作给定的二叉树,将其变换为源二叉树的镜像。
     */
    public class TreeNode2 {
        int val = 0;
        TreeNode2 left = null;
        TreeNode2 right = null;

        public TreeNode2(int val) {
            this.val = val;

        }

    }

    public void Mirror(TreeNode2 root) {
        if (root == null) {
            return;
        }
        if (root.left == null && root.right == null) {
            return;
        }

        TreeNode2 tn = root.left;
        root.left = root.right;
        root.right = tn;

        if (root.left != null) {
            Mirror(root.left);
        }
        if (root.right != null) {
            Mirror(root.right);
        }
    }

    /**
     * 包含min函数的栈
     * 
     * 定义栈的数据结构,请在该类型中实现一个能够得到栈最小元素的min函数
     */

    Stack<Integer> data = new Stack<Integer>();
    Stack<Integer> min = new Stack<Integer>();

    public void push(int node) {

        data.push(node);
        if (min.size() == 0) {
            min.push(node);
        } else {
            if (node < min.peek()) {
                min.push(node);

            } else {
                min.push(min.peek());
            }
        }
    }

    public void pop() {
        data.pop();
        min.pop();

    }

    public int top() {
        return data.peek();
    }

    public int min() {
        return min.peek();
    }

    /**
     * 
     * 从上往下打印二叉树( 广度优先遍历二叉树)
     * 
     * 思路是用arraylist模拟一个队列来存储相应的TreeNode
     */
    public ArrayList<Integer> PrintFromTopToBottom(TreeNode root) {
        ArrayList<Integer> list = new ArrayList<>();
        ArrayList<TreeNode> queue = new ArrayList<>();
        if (root == null) {
            return list;
        }
        queue.add(root);
        while (queue.size() != 0) {
            TreeNode temp = queue.remove(0);
            if (temp.left != null) {
                queue.add(temp.left);
            }
            if (temp.right != null) {
                queue.add(temp.right);
            }
            list.add(temp.val);
        }
        return list;
    }

    /**
     * 
     * 栈的压入、弹出序列
     * 
     * 题目描述:
     * 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序。假设压入栈的所有数字均不相等。例如序列1,2,3,4,5
     * 是某栈的压入顺序
     * ,序列4,5,3,2,1是该压栈序列对应的一个弹出序列,但4,3,5,1,2就不可能是该压栈序列的弹出序列。(注意:这两个序列的长度是相等的)
     */
    public boolean IsPopOrder(int[] pushA, int[] popA) {
        if (pushA.length == 0 || popA.length == 0)
            return false;
        Stack<Integer> s = new Stack<Integer>();
        // 用于标识弹出序列的位置
        int popIndex = 0;
        for (int i = 0; i < pushA.length; i++) {
            s.push(pushA[i]);
            // 如果栈不为空,且栈顶元素等于弹出序列
            while (!s.empty() && s.peek() == popA[popIndex]) {
                // 出栈
                s.pop();
                // 弹出序列向后一位
                popIndex++;
            }
        }
        return s.empty();
    }

    /**
     * 二叉搜索树的后序遍历序列
     * 
     * 输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果。如果是则输出Yes,否则输出No。假设输入的数组的任意两个数字都互不相同。
     */

    // 左子树一定比右子树小,因此去掉根后,数字分为left,right两部分,right部分的
    // 最后一个数字是右子树的根他也比左子树所有值大
    public boolean VerifySquenceOfBST(int[] sequence) {
        int size = sequence.length;
        if (0 == size)
            return false;

        int i = 0;
        while (size != 0) {
            while (sequence[i] < sequence[size - 1]) {
                i++;
            }
            while (sequence[i] > sequence[size - 1]) {
                i++;
            }

            if (i != size - 1)
                return false;
            i = 0;
            size--;
        }
        return true;
    }

    /**
     * 二叉树中和为某一值的路径
     * 
     * 输入一颗二叉树和一个整数,打印出二叉树中结点值的和为输入整数的所有路径。路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径。
     */
    private ArrayList<ArrayList<Integer>> listAll = new ArrayList<ArrayList<Integer>>();
    private ArrayList<Integer> list = new ArrayList<Integer>();

    public ArrayList<ArrayList<Integer>> FindPath(TreeNode root, int target) {
        if (root != null) {
            list.add(root.val);
            target -= root.val;
            if (target == 0 && root.left == null && root.right == null)
                listAll.add(new ArrayList<Integer>(list));
            FindPath(root.left, target);
            FindPath(root.right, target);
            target += root.val;
            list.remove(list.size() - 1);
        }
        return listAll;
    }

    /**
     * 字符串的排列
     * 
     * 输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,
     * bac,bca,cab和cba。 结果请按字母顺序输出
     */

    public static ArrayList<String> Permutation(String str) {
        ArrayList<String> al = new ArrayList<String>();
        if (str == null || str.length() == 0) {
            return al;
        }
        Set<String> set = new HashSet<String>();
        permutation(set, str.toCharArray(), 0);
        al.addAll(set);
        Collections.sort(al);
        return al;
    }

    public static void permutation(Set<String> set, char[] buf, int k) {
        if (k == buf.length - 1) {// 当只要求对数组中一个字母进行全排列时,只要就按该数组输出即可
            set.add(new String(buf));
            return;
        } else {// 多个字母全排列
            for (int i = k; i < buf.length; i++) {
                char temp = buf[k];// 交换数组第一个元素与后续的元素
                buf[k] = buf[i];
                buf[i] = temp;

                permutation(set, buf, k + 1);// 后续元素递归全排列

                temp = buf[k];// 将交换后的数组还原
                buf[k] = buf[i];
                buf[i] = temp;
            }
        }

    }

}

其他

    /**
     * 大整数乘法(复杂度:O(m*n))
     * 
     * @param str1
     * @param str2
     */
    public static void multiply(String str1, String str2) {
        char[] c1 = str1.toCharArray();
        char[] c2 = str2.toCharArray();
        int m = str1.length();
        int n = str2.length();
        int array[] = new int[m + n];// 两数乘积位数不会超过两数的位数之和
        // 高低位对调,为了低位对齐
        covert(c1);
        covert(c2);

        // 对齐逐位相乘
        for (int i = 0; i < m; i++)
            for (int j = 0; j < n; j++) {
                array[i + j] = array[i + j] + Integer.parseInt(c1[i] + "")
                        * Integer.parseInt(String.valueOf(c2[j]));
            }

        // 进位
        for (int i = 0; i < m + n; i++) {
            int temp = array[i] / 10;
            if (temp > 0) {
                array[i] = array[i] % 10;
                array[i + 1] += temp;
            }
        }
        String res = "";
        for (int i = m + n - 1; i >= 0; i--) {
            res = res + array[i];
        }
        // 删除结果前面的0
        int i = 0;
        while (res.charAt(i) == '0') {
            i++;
        }
        System.out.print(res.substring(i));
    }

    public static void covert(char[] c) {
        for (int i = 0; i < c.length / 2; i++) {
            char temp = c[i];
            c[i] = c[c.length - 1 - i];
            c[c.length - 1 - i] = temp;
        }
    }
}
    /**
     * 反转链表
     * 
     * @param head
     * @return
     */
    public ListNode ReverseList(ListNode head) {
        ListNode next = null;
        ListNode pre = null;
        while (head != null) {
            next = head.next;
            head.next = pre;
            pre = head;
            head = next;
        }
        return pre;
    }

已放到github https://github.com/ALLENnan/Allen-Study

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,835评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,598评论 1 295
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,569评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,159评论 0 213
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,533评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,710评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,923评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,674评论 0 203
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,421评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,622评论 2 245
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,115评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,428评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,114评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,097评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,875评论 0 197
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,753评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,649评论 2 271

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 170,569评论 25 707
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,088评论 2 44
  • 几乎每一个可测量的心理特质,包括智商、人格、艺术能力、数学能力、音乐能力、写作能力、幽默风格、创意舞蹈、体育、幸福...
    烈日逐风阅读 246评论 0 0
  • 《母亲的味道》最早写于2016年母亲节。发了两家报纸,又被《山西市政》杂志收录。昨天在百度意外发现,今年又被《思维...
    落雪小屋阅读 893评论 8 61
  • 今天回到家,钥匙插进去使劲儿扭,发现扭不动。心想:不会是锁坏了吧。然后试着往反方向扭,扭了三圈终于打开了门。往常开...
    茉莉大大阅读 192评论 0 0