java二叉树查找、遍历、添加与删除package com.structures.tree;import java.util.ArrayList;import java.util.NoSuchElementException;import java.util.Stack;/* * Binary Search Tree */public ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1942浏览 2574个赞
C语言分割字符串strtok函数int argc = 0; char** argv = (char **) malloc(30 * sizeof(char *)); char *token = NULL; const char* delim = ","; const char* str = "My……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1507浏览 1850个赞
C语言基础:格式化浮点数输出#include <stdio.h>int main () { float value = 1.23456; printf ("%8.1f\n", value); printf ("%8.3f\n", value); printf ("……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2332浏览 2967个赞
C语言基础:for循环里矢量2个循环因子变量#include <stdio.h>int main() { int i, j; for (i = 0, j = 100; i <= 100; i++, j++) printf("i = %d j = %d\n", i, j);return 1……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1452浏览 991个赞
C语言二叉树遍历代码来自于郝斌老师的数据结构#include<stdio.h>#include<malloc.h>struct BTNode{char data;struct BTNode * pLchild;struct BTNode * pRchild;};void PreTraverseBTree(stru……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2854浏览 2413个赞
C语言基础:for循环语句使用范例演示#include <stdio.h>int main () { int counter; for (counter = -100; counter <= 100; counter += 5) printf("%d ", counter); prin……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2034浏览 1065个赞
C语言基础:for从大到小循环语句范例#include <stdio.h>int main () { int counter; for (counter = 5; counter >= 1; counter--) printf("%d ", counter); printf("……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2518浏览 2751个赞
C语言基础:for循环演示代码,字符循环和浮点数循环#include <stdio.h>int main () { char letter; float percent; for (letter = 'A'; letter <= 'Z'; letter++) pu……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1918浏览 2028个赞
C语言基础:格式化输出带符号的数字#include <stdio.h>int main () { int int_value = 5; printf("Left justifed with sign %-+3d\n", int_value);return 1; } ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2549浏览 1888个赞
C语言基础:goto语句用法演示#include <stdio.h>int main() { int count = 1; label: printf("%d ", count++); if (count <= 100) goto label;retu……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2026浏览 1059个赞
C语言基础:一个无限循环程序(死循环,不要运行)#include <stdio.h>int main () { int i; int result = 0; int value = 1; for (i = 0; i < 100; i++) { printf("%d "……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1980浏览 244个赞
C语言基础:格式化整数输出#include <stdio.h>int main () { int value = 5; printf ("%1d\n", value); printf ("%2d\n", value); printf ("%3d\n", ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2754浏览 524个赞
C语言基础:while语句使用范例#include <stdio.h>int main() { int counter = 1; // Initialize the control variable while (counter <= 100) // Test the control variable ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2889浏览 2848个赞
C语言基础:向左向右对其输出数字#include <stdio.h>int main () { int int_value = 5; float flt_value = 3.33; printf("Right justified %5d value\n", int_value); printf……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1615浏览 2848个赞
C语言基础:简单的数学运算#include <stdio.h>int main () { int seconds_in_an_hour; float average; seconds_in_an_hour = 60 * 60; average = (5 + 10 + 15 + 20) / 4; pr……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1414浏览 2074个赞
C语言基础:求模和取余演示#include <stdio.h>int main () { int remainder; int result; result = 10 / 3; remainder = 10 % 3; printf("10 Divided by 3 is %d Remainder ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 3053浏览 730个赞
C语言基础:输出100以内的奇数和偶数#include <stdio.h>int main() { int counter; printf("\nEven values\n"); for (counter = 1; counter <= 100; counter++) { ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1374浏览 2418个赞
1. RSA说明RSA公钥加密算法是1977年由Ron Rivest、Adi Shamirh和LenAdleman在(美国麻省理工学院)开发的。RSA取名来自开发他们三者的名字。RSA算法基于一个十分简单的数论事实:将两个大素数相乘十分容易,但那时想要对其乘积进行因式分解却极其困难,因此可以将乘积公开作为加密密钥。2. RSA算法实现RSA算法是一种非对称密……继续阅读 » 水墨上仙 5年前 (2021-03-22) 3229浏览 123个赞
C语言基础:将整数格式化成其它进制输出,如8进制,16进制#include <stdio.h>int main () { int value = 255; printf("The decimal value %d in octal is %o\n", value, value); p……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2652浏览 361个赞
C语言基础:自增自减符号位置的区别,– a和a–的区别演示#include <stdio.h>int main () { int value = 1; printf("Using postfix %d\n", value--); printf("Valu……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1664浏览 2343个赞
C语言基础:break语句使用范例代码#include <stdio.h>int main() { int counter; for (counter = 1; counter <= 100; counter++) { if (counter == 50) break; ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1476浏览 2068个赞
C语言基础:结构体及指针使用范例#include <stdio.h>#include <alloc.h>int main(void) { int i; struct ListEntry { int number; struct ListEntry *next; } start, *no……继续阅读 » 水墨上仙 5年前 (2021-03-22) 3249浏览 1869个赞
C语言基础:常量的使用#include <stdio.h>#define ARRAY_SIZE 5int main(void) { int values[ARRAY_SIZE] = {80, 70, 90, 85, 80}; int i; for (i = 0; i < ARRAY_SIZE; i++) ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1856浏览 1385个赞
C语言数组:数组初始化代码演示#include <stdio.h>int main(void) { int values[5] = {80, 70, 90, 85, 80}; int i; for (i = 0; i < 5; i++) printf("values[%d] %d\n"……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2769浏览 383个赞
《C++ Primer》中说:在C++中没有多维数组,只有元素师数组的数组。如:要想创建一个二维整数数组,首先要创建一个一维动态数组,它由int *类型的指针构成。int*就是这个一维int指针数组的类型。// String.cpp : Defines the entry point for the console application.//#……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2584浏览 1810个赞
C语言基础:输出变量的内存地址#include <stdio.h>int main(void) { int count = 1; float salary = 40000.0; long distance = 1234567L; printf("Address of count is %x\n"……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1710浏览 278个赞
C语言基础:输出数组的内存地址#include <stdio.h>int main(void) { int count[10]; float salaries[5]; long distances[10]; printf("Address of the array count is %x\n"……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2417浏览 2740个赞
C语言基础:获取数组的长度#include <stdio.h>int main(void) { int scores[100]; float salaries[100]; char string[100]; printf("Bytes used to hold int scores[100] is %d……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1849浏览 1153个赞
C语言基础:两个获取数组地址的方法#include <stdio.h>int main(void) { int count[10]; float salaries[5]; long distances[10]; printf("Address of the array count is %x &……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2352浏览 2545个赞
C语言基础:数组作为函数参数调用代码演示#include <stdio.h>void show_array(int values[], int number_of_elements) { int i; for (i = 0; i < number_of_elements; i++) printf("%……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1764浏览 902个赞
C语言基础:数组作为函数参数传递演示代码#include <stdio.h>void show_array(int values[], int number_of_elements) { int i; printf("About to display %d values\n", number_of_ele……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1395浏览 962个赞
C语言基础:二分查找法演示代码#include <stdio.h>int binary_search(int array[], int value, int size) { int found = 0; int high = size, low = 0, mid; mid = (high + low) / 2; ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1937浏览 1153个赞
C语言基础:修改结构体数据#include <stdio.h>struct Shape { int type; int color; float radius; float area; float perimeter;};void change_structure(struct Shape *shape) { ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1605浏览 1467个赞
反转单向链表分为递归和非递归两种方式。递归的实现方式比较简单,而非递归实现效率较高,在面试时应注意边界条件。 这道题在面试时被要求现场作答的概率还是很大的,比较tricky的地方就是要在当前条件下保存好next of next的指针,如果一时想不起来程序怎么写,可以先自己画个图看看。// ReverseList.cpp : Defines the en……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1649浏览 2032个赞
C语言递归实现全排列来源:http://blog.csdn.net/creazyapple/article/details/7932432#include <stdio.h>int Swap(char *a,char *b){ char c; c = *a; *a = *b; *b = c;}/* ……继续阅读 » 水墨上仙 5年前 (2021-03-22) 3141浏览 1424个赞
大家都知道,只有一个数时不用排序, 1.插入排序, 从第二个数开始,先将第二个数做一个副本放在一旁(变量中)。2.第二个数同前一个数比较,小于则用前一个数覆盖第二个数, 然后将副本放在前一个数前面3.再将第三个数做一个副本取出,第三个数同前一个数比较,小于则用前一个数覆盖第三个数(此时第二个数位置空闲), 然后用副本同前一个数的前一个数比较,如果小于,则用前……继续阅读 » 水墨上仙 5年前 (2021-03-22) 3023浏览 1028个赞
C语言解决8皇后问题#include<iostream>using std::cout;using std::endl;#define my_abs(x) ((x)>=0?(x):(-(x)))const int n=8;void output(int a[],int n){static int count=1;cou……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1963浏览 2228个赞
C语言基础:数组元素访问 #include <stdio.h>int main(void) { int scores[5] = {80, 70, 90, 85, 80}; printf("Array Values\n"); printf("scores[0] %d\n", sco……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2913浏览 1096个赞
C语言数组:二位数组使用演示#include <stdio.h>void show_2d_array(int array[][10], int rows) { int i, j; for (i = 0; i < rows; i++) for (j = 0; j < 10; j++) pri……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1391浏览 2086个赞
C语言基础:结构体初始化#include <stdio.h>int main(void) { struct Shape { int type; int color; float radius; float area; float perimeter; } circle = {0, 1,……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1548浏览 2408个赞
C语言基础:计算多维数组的大小#include <stdio.h>int main(void) { int box[3][3]; float year_sales[52][5]; char pages[40][60][20]; printf("Bytes to hold int box[3][3] %d……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2612浏览 966个赞
C语言基础:指针使用演示代码#include <stdio.h>int main(void) { int counter = 10; int *iptr; // Declare pointer value iptr = // Assign the address printf("……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1712浏览 1401个赞
C语言基础:通过指针遍历字符数组转换字符串为大写#include <stdio.h>#include <ctype.h>char *string_uppercase(char *string) { char *starting_address; starting_address = string; whi……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2638浏览 2948个赞
c语言实现的通用二分查找算法作者:wallwind来源:http://blog.csdn.net/wallwind/article/details/8272141///* 二分查找是基于排好序的算法。复杂度低,并且很高效, 由于项目中大量使用的了二分查找,但是又不能每个业务实现一个 因此有必要实现一个通用的二分查找 其主要思想:通过对已经排好……继续阅读 » 水墨上仙 5年前 (2021-03-22) 1891浏览 648个赞
来源:……继续阅读 » 水墨上仙 5年前 (2021-03-22) 2655浏览 2500个赞