自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

A_Bo的博客

不怕别人比你聪明,就怕别人比你聪明还比你努力

  • 博客(231)
  • 收藏
  • 关注

原创 Element中添加自定义全部选项并使用v-model绑定

业务需求有些业务需求中需要使用全部,但是有些地方的搜索中不需要全部选项,想单独封装一个组件,但是感觉有点小题大作,并且如果向表单中使用unshift新增选项,这样对于不使用全部选项的又不合适另外初始进页面需要默认选中全部,这里就需要使用v-model进行双向绑定实现<el-select v-model="dealData.state" placeholder="请选择状态类型">\ <el-option key="" value="" label="全部">

2020-08-10 19:11:17 1628

原创 Vue小demo

实现了一个可以编辑/查看的小组件<template> <div> <button @click="openChild">{{dialogTitle}}</button> <HelloWorld :show="show" :article="article" ref="alert" @eidtMsg="editMsg" @closeDialog="closeDialog" @cancldDiakog="canc...

2020-08-01 13:47:10 336

原创 C++原始指针模拟实现reverse函数

写在前面今天笔试中有一个题目,要求将单词翻转,例如"hx hell1 liwe! asfd",根据空格来划分单词,如果单词中存在非字母,则原样输出,否则翻转输出(不能使用函数库函数)程序#include &lt;iostream&gt;#include &lt;algorithm&gt;#include &lt;string&gt;#include &lt;string.h&g...

2019-03-04 21:11:15 1229

原创 1119 Pre- and Post-order Traversals (30 分)

目录1119Pre- and Post-order Traversals题目描述解题思路程序1119Pre- and Post-order Traversals题目描述Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can ...

2019-03-01 16:37:02 2051 5

原创 AVL_tree_1123 Is It a Complete AVL Tree (30 分)

目录1123Is It a Complete AVL Tree题目描述解题思路程序1123Is It a Complete AVL Tree题目描述An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees o...

2019-03-01 13:03:30 330

原创 Eulerian_1126 Eulerian Path (25 分)

目录1126Eulerian Path题目描述解题思路程序vector中resize和reserve函数的区别参考博客1126Eulerian Path题目描述In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Simi...

2019-03-01 10:17:49 488

原创 LCA_1143 Lowest Common Ancestor (30 分)

目录1143 Lowest Common Ancestor 解题思路程序参考博客1143 Lowest Common AncestorThe lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants....

2019-02-27 15:58:06 332

原创 Sort_1141 PAT Ranking of Institutions (25 分)

目录1141 PAT Ranking of Institutions题目描述解题思路程序1141 PAT Ranking of Institutions题目描述After each PAT, the PAT Center will announce the ranking of institutions based on their students' performa...

2019-02-27 15:18:41 289

原创 模拟_1150 Travelling Salesman Problem

目录1150 Travelling Salesman Problem题目描述解题思路程序1150 Travelling Salesman Problem题目描述The "travelling salesman problem" asks the following question: "Given a list of cities and the distances b...

2019-02-27 11:11:46 343

原创 dfs_1155 Heap Paths (30 分)

目录1155 Heap Paths题目描述解题思路程序1155 Heap Paths题目描述In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then th...

2019-02-26 21:13:30 313

原创 dfs_1106 Lowest Price in Supply Chain (25 分)

目录1106 Lowest Price in Supply Chain题目描述解题思路程序1106 Lowest Price in Supply Chain题目描述A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved...

2019-02-26 16:45:06 317

原创 dfs_1103 Integer Factorization (30 分)

目录1103 Integer Factorization题目描述解题思路程序1103 Integer Factorization题目描述The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You a...

2019-02-26 16:06:22 228

原创 模拟_1105 Spiral Matrix (25 分)

目录1105 Spiral Matrix题目描述解题思路程序 1105 Spiral Matrix题目描述This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is fill...

2019-02-26 13:17:35 615

原创 二叉树_1099 Build A Binary Search Tree (30 分)

目录1099 Build A Binary Search Tree题目描述解题思路程序参考博客1099 Build A Binary Search Tree题目描述A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:...

2019-02-25 19:41:38 685

原创 STL_1095 Cars on Campus (30 分)

1095 Cars on Campus题目描述Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the i...

2019-02-25 17:58:56 521

原创 Heap Sort_1098 Insertion or Heap Sort (25 分)

目录题目描述解题思路插入排序堆排序(大顶堆排序)程序参考博客题目描述According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, inser...

2019-02-25 15:36:45 251

原创 BFS_1091 Acute Stroke (30 分)

目录题目描述Input Specification:Output Specification:Sample Input:Sample Output:解题思路程序题目描述One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the ...

2019-02-25 11:24:53 359 1

原创 unordered_set,unordered_map中自定义hashfunction

写在前面在c++11新标准中引入了unordered_set以及unordered_map,其背后是根据hash实现,而set、map等背后是根据RB_tree实现,在实现hash时,需要将数据转换为对应的hash码,放入对应的bucket中,所以这里的hash function是至关重要的简单的hash function我们可以通过hash_function()函数得到对应的hash...

2019-02-22 11:50:05 3701

原创 c++ Variadic Templates(可变参数列表)

写在前面在c++11中新引入了Variadic Templates(可变参数列表),和initialize_list不同的是,Variadic Templates可以支持不同类型的参数,而initialize_list只支持同一种类型的参数,并且在vector、max等容器或者函数中内部已经实现了initialize_list,那么Variadic Templates的用法更加广泛,其中体现最...

2019-02-17 21:59:43 1029

原创 C++中的new_handler、set_new_handler、get_new_handler函数

写在前面在operator new或者operator new[]内存分配失败时,会不止一次调用由client指定的handler(当然handler也有默认形式),可以有源码中发现void* operator new(size_t size,const std::nothrow_t&amp;)_THROW0(){ void* p; while((p==malloc(size))=...

2019-02-14 11:40:41 882

原创 C++中自定义简单内存配置器

目录写在前面参考程序第一版本第二版本第三版本参考文献写在前面通过C++中内存分配的几种方式我们知道,如果我们要使用自己定义的内存配置器,需要我们重载operator new、operator delete、operator new[]、operator delete[]四个函数,但是前面的我们通过模拟内部实现来进行的,这里我们将重新定义其内存配置方式,程序均参考于书...

2019-02-14 09:46:33 522

原创 list_1097 Deduplication on a Linked List (25 分)

1097 Deduplication on a Linked List (25 分)Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each value K,...

2019-02-09 22:53:56 244

原创 C++中内存分配的几种方式

目录写在前面函数解释malloc/free函数new/delete函数array new/delete函数::operator new/delete函数new整体流程delete整体流程operator new/delete的重载写在前面C++中内存分配十分重要,并且容易造成内存泄露等等问题,之前只是知道new和delete底层调用的是malloc和fr...

2019-02-09 15:50:12 3920

原创 c++11 左值右值

目录写在前面 栗子左值右值std::move:强制转化为右值参考文献写在前面在c++2.0之前存在着Big Three,分别是析构函数、拷贝构造函数、拷贝赋值函数A(const A&amp;);A &amp;operator(const A&amp;);~A();在c++2.0之后新增了移动语义,所以也就新增了,移动构造函数,移动赋值函数A(A&am...

2019-02-09 09:34:47 290

原创 完全二叉树_1110 Complete Binary Tree

目录题目描述思路程序参考博客题目描述1110 Complete Binary Tree (25 分)Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input file contains one test case. F...

2019-02-05 21:29:16 496

原创 sort_1109 Group Photo

1109 Group Photo (25 分)Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each row must be N/K (round...

2019-02-04 11:41:47 176

原创 sort_1137 Final Grading

1137 Final Grading (25 分)For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain n...

2019-02-02 18:13:14 208

原创 queue_1133 Splitting A Linked List

1133 Splitting A Linked List (25 分)Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values i...

2019-02-02 12:41:05 146

原创 BFS_1094 The Largest Generation

1094 The Largest Generation (25 分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation ...

2019-02-01 20:46:22 189

原创 思路_1093 Count PAT's (25 分)

1093 Count PAT's (25 分)The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and ...

2019-02-01 18:16:36 228

原创 拓扑排序_1146 Topological Order

1146 Topological Order (25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supp...

2019-02-01 16:32:15 231

原创 暴力_1144 The Missing Number

1144 The Missing Number (20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. F...

2019-02-01 14:35:53 150

原创 并查集_1118 Birds in Forest

1118 Birds in Forest (25 分)Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the...

2019-01-30 14:20:19 264

原创 素数判定_1116 Come on! Let's C

1116 Come on! Let's C (20 分)"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun...

2019-01-29 22:34:27 152

原创 模拟_1122 Hamiltonian Cycle (25 分)

1122 Hamiltonian Cycle (25 分)The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle".In this problem, you are sup...

2019-01-29 18:20:44 343

原创 模拟_1121 Damn Single (25 分)

1121 Damn Single (25 分)"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input ...

2019-01-29 15:49:02 189

原创 BFS_1090 Highest Price in Supply Chain (25 分)

1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Star...

2019-01-29 10:40:32 283

原创 c++11初始化列表(initializer_list)

目录写在前面详述initializer_list部分源码方法使用参考文献 写在前面c++11标准中,initializer_list对于标准库的编写影响非常大,说一个简单的例子,在c++11之前,max函数的源程序是这样的:template &lt;class T&gt; const T&amp; max (const T&amp; a, const T&...

2019-01-18 18:38:22 8681

原创 模拟_1080 Graduate Admission (30 分)

1080 Graduate Admission (30 分)It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a p...

2019-01-12 22:29:48 376

原创 BFS_1076 Forwards on Weibo (30 分)

1076 Forwards on Weibo (30 分)Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed wi...

2019-01-11 17:13:15 215

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除