自然对齐:
1.一个基本类型实例的大小要能整除其地址值。
2.数组有着和数组里类型本身相同的对齐要求。
3.一个聚集类型的实例,其对齐要求最严格的子类型的排列要能整除聚集的地址
在32位机器上,
char的大小为1(以字节计),所以它可以被存储在内存的任意地址处
short的大小为2,所以它只能存储在“偶数”地址处
integer和指针的大小为4(32位机上一个字为4个字节),所以它们只能存储在一个字界中
double的大小为8,所以它只能存储在两个字界中...
分类:
其他好文 时间:
2014-06-05 03:52:15
阅读次数:
200
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()...
分类:
其他好文 时间:
2014-06-05 02:15:14
阅读次数:
262
/*
*Copyright (c) 2013, 烟台大学计算机学院
* All rights reserved.
* 作 者:马广明
* 完成日期:2014 年 5 月 18 日
* 版 本 号:v1.0
* 问题描述:摩托车继承自行车和机动车
*/
#include
#include
#include
using namespace std;
enum vehi...
分类:
其他好文 时间:
2014-06-05 01:49:51
阅读次数:
319
【题目】
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before imple...
分类:
其他好文 时间:
2014-06-04 23:45:09
阅读次数:
388
/*
* Copyright (c) 2013, 烟台大学计算机学院
* All rights reserved.
* 作 者:马广明
* 完成日期:2014 年 5 月 27 日
* 版 本 号:v1.0
* 问题描述:动物这样叫
*/
#include
using namespace std;
class Animal
{
public:
vi...
分类:
其他好文 时间:
2014-06-04 23:18:59
阅读次数:
294
利用rman自动备份转储spfile
【情景简介】
生产环境丢失了服务器的参数文件,rman已开启自动备份设置。
【操作过程简述】
----启动rman
$rman target /
----检查rman设置
RMAN> show all;
----配置一遍rman自动备份控制文件,模拟初次设置rman自动备份控制文件
RMAN>CONFIGURE CONTROLFILEA...
分类:
其他好文 时间:
2014-06-04 22:54:12
阅读次数:
257
【题目】
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
【题意】
给定一个已排序的链表,删除其中的重复元素
【思路】
维护两个指针prev和cur, cur指针负责扫描链表,prev指向cur的前一...
分类:
其他好文 时间:
2014-06-03 04:05:39
阅读次数:
231
已知一副RGB图像中的的像素值,利用matlab将其分割出来并以二进制图像形式显示:
%extract.m
clear all;
I=imread('new_original.png');
figure,imshow(I),title('Original Image');
bw=im2bw(I,0.3);
%figure,imshow(bw),title('Gray Image');
rgb=[...
分类:
其他好文 时间:
2014-06-03 02:46:26
阅读次数:
989
【题目】
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1->1->2->3, return 2->3.
【题意】
给定一个有序链表,删出其中重复出现的值...
分类:
其他好文 时间:
2014-05-31 21:14:11
阅读次数:
333
题目一:CombinationsGiven two integersnandk, return all
possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a
solution is:[ [2,4],....
分类:
其他好文 时间:
2014-05-31 20:01:02
阅读次数:
455