上一篇博文介绍了如何使用C语言实现单链表,这篇博文介绍下双向链表的实现。单链表中每个结点只有一个后驱,而双向链表中每个结点都有一个后驱和前驱(除了第一个结点只有一个后驱,最后一个结点只有一个前驱)。双向链表中每个结点具有一个数据域和两个指向前一个结点和后一个结点的指针域。代码的实现:
首先得创建一个结点的结构体:Double_Node
typedef struct Double_Node
{
...
分类:
其他好文 时间:
2014-07-26 17:18:22
阅读次数:
317
解: 公共过程 (define?(even??n)
??(=?(remainder?n?2)?0))
(define?(double?n)
??(+?n?n))
(define?(halve?n)
??(/?n?2)) 1.16: (define?(expt?b?n)
??(define?(iter?b?n?a)
...
分类:
其他好文 时间:
2014-07-26 15:41:42
阅读次数:
232
继承类的范围,构造函数和拷贝控制
当用派生类执行函数的时候,首先会在当前的类里面找
如果找不到就一级一级地往上找。
Name Lookup Happens at Compile Time
class Quote
{
public:
Quote()=default;
Quote(const string &book, double sales_price)...
分类:
编程语言 时间:
2014-07-26 15:29:42
阅读次数:
542
C++结构体定义struct inflatable{ char name[20]; float volume; double price;}C++创建结构本:inflatable guest={ "Glorious Gloria", 1.88, 29.99};在C中是要加上struc...
分类:
编程语言 时间:
2014-07-26 14:25:00
阅读次数:
238
首先看geeksforgeeks上的两个程序:
程序1:
#include
int main()
{
float x = 0.1;
if (x == 0.1)
printf("IF");
else if (x == 0.1f)
printf("ELSE IF");
else
printf("ELSE");
}
程...
分类:
其他好文 时间:
2014-07-26 03:03:46
阅读次数:
142
注意数组的大小,以及字符的输入问题
#include
#include
int dp[4000000],a[4],money[400];
char s[120];
double str[120];
int max(int a,int b)
{return a>b?a:b;}
int main()
{
int N,sum,ans,ok,count,i,j,num;
double Q...
分类:
其他好文 时间:
2014-07-26 02:38:26
阅读次数:
253
/*
* javaBean代码
*/
package bean;
public class Box {
double length;
double width;
double height;
public Box()
{
length=0;
width=0;
height=0;
}
public double getLength() {
return lengt...
分类:
编程语言 时间:
2014-07-26 02:31:36
阅读次数:
267
B树、B-树、B+树、B*树、红黑树rbtree 二叉排序树、trie树Double Array 字典查找树
B树
即二叉搜索树:
1.所有非叶子结点至多拥有两个儿子(Left和Right);
2.所有结点存储一个关键字;
3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树;
...
分类:
其他好文 时间:
2014-07-26 02:24:36
阅读次数:
232
#include #include #include using namespace std;int main(){double c,h,o,n;int t,i,j;cin>>t;getchar();double ans;char s[100];while (t-->0){gets(s);c=0;h...
分类:
其他好文 时间:
2014-07-26 01:47:46
阅读次数:
248
#include #include #include #include #include #include using namespace std;using namespace boost;void double_int(int & i){ i *= 2;}mutex io_mu;void pri...
分类:
其他好文 时间:
2014-07-26 00:59:46
阅读次数:
253