自己动手实现数据结构模板(3):栈和队列
栈和队列的实现借助了链表。到链表实现方法的链接。
继承了dtsList,然后在此基础上增加了push、pop等函数来入出栈或队列,增加了返回 栈底和栈顶 或 队头和队尾 的值的函数。
具体实现:
栈:
#ifndef DTS_STACK_HPP #define DTS_STACK_HP[......]
栈和队列的实现借助了链表。到链表实现方法的链接。
继承了dtsList,然后在此基础上增加了push、pop等函数来入出栈或队列,增加了返回 栈底和栈顶 或 队头和队尾 的值的函数。
栈:
#ifndef DTS_STACK_HPP #define DTS_STACK_HP[......]
二叉树结点结构:
template <typename T> class dtsBinaryTreeNode{ public: T value;//该结点值 dtsBinaryTreeNode<T>* leftChild;//左孩子结点 d[......]
题目:
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
Example 1:
Input: 12[……]
今天忽然心血来潮,自己动手实现了一个简单的双向链表和基本功能,大致实现了如下功能
dtsListNode为结点类,包括值value、前向指针pre和后向指针next。
dtsList为双向链表,能够通过begin和end函数获得首地址指针和指向最后一个元素之后一个的尾[……]
题目:
There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different wi[……]
1.查看挂载的U盘的设备名称,一般按照大概的容量或者拔插前的区别来看。此处U盘设备名为sdd1
╰─$ sudo fdisk -l 1 ↵ ... Disk /dev/sdd[......]
安装winetricks,运行。
sudo apt install -y winetricks winetricks
在图形化界面中依次选择 Select the default wineprefix -> Delete ALL DATA AND APPLICATIONS ISIDE T[……]
安装wine时,因为缺少了中文字体,所以中文字体有时会显示为方框。在这里,我给出一种解决方案。
第一步:下载想要的字体,比如宋体simsum.ttc。
下载链接:https://github.com/sonatype/maven-guide-zh/raw/master/content-z[……]
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their n[……]
感受到了自己与大神的差距,同样的题,我的代码跑140ms,大神的只要4ms。
Given an array of integers, return indices of the two numbers such that they add up to a specific target.[……]