![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
后山之人
这个作者很懒,什么都没留下…
展开
-
螺旋队列算法分析
一道题:21 22 ....20 7 8 9 1019 6 1 2 1118 5 4 3 1217 16 15 14 13看清以上数字排列的规律,设 1 点的坐标是 (0,0),x 方向向右为正,y 方向向下为正。例如,7 的坐标为 (-1,-1),2 的坐标为 (0,1),3 的坐标为 (1,1)。编程实现输入任意一原创 2014-08-14 12:09:08 · 611 阅读 · 0 评论 -
define a class for a linked list and write a method to delete the nth node.
1、问题define a class for a linked list and write a method to delete the nth node.2、算法template struct Node{ C content ; Node* next ;}template class List{private:原创 2014-09-03 11:36:49 · 734 阅读 · 0 评论 -
Define a one-to-many dependency between objects so that when one object changes state, all its depe
1、问题Define a one-to-many dependency between objects so that when one object changes state, all its dependents are nofitied and updated automatically.2、算法原创 2014-09-03 18:40:11 · 583 阅读 · 0 评论 -
如何将a、b的值进行交换,并且不使用任何中间变量
1、问题如何将a、b的值进行交换,并且不使用任何中间变量2、算法通过计算交换a、b的值 a、加减法运算 a = a + b; b = a - b ; a = a - b ; 当 a和b 的值比较大时会有越界问题。 b、使用位运算 a = a^b ;原创 2014-08-14 12:35:20 · 832 阅读 · 0 评论 -
有两个变量a和b,不用“if”、“? :”、“switch”或其他判断语句,找出两个数中比较大的
1、问题There are two int variables: a and b, don't use "if"、"? :"、"switch" or other judgement statement, find out the biggest one of the two numbers.(有两个变量a和b,不用“if”、“? :”、“switch”或其他判断语句,找出两个数中比较大原创 2014-09-03 10:28:05 · 4034 阅读 · 2 评论 -
Implement a stack that pops out the mostfrequently added item. Stack supports 3 functions – push,
1、问题Implement a stack that pops out the mostfrequently added item. Stack supports 3 functions – push, pop and top.Givecomplexity of each functions in your implementation2、算法实现有两种,一种使用标准库中的原创 2014-09-03 18:31:44 · 489 阅读 · 0 评论 -
Write a program to convert string to number without using library function。
/*Write a program that prints the numbers from 1 to 100,but for multiples of three print “Fizz” instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of原创 2014-09-03 10:34:55 · 736 阅读 · 0 评论 -
Write a program that prints the numbers from 1 to 100,but for multiples of three print “Fizz” inste
1、问题/*Write a program that prints the numbers from 1 to 100,but for multiples of three print “Fizz” instead of the number and for the multiples of five print "Buzz". For numbers which are multipl原创 2014-09-03 10:35:29 · 2177 阅读 · 0 评论