2017年12月26日

堆和栈的区别

摘要: 一、预备知识—程序的内存分配 一个由C/C++编译的程序占用的内存分为以下几个部分 1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其 操作方式类似于数据结构中的栈。 2、堆区(heap) — ... 阅读全文

posted @ 2017-12-26 20:53 sichenzhao 阅读(110) 评论(0) 推荐(0) 编辑

c++-add two numbers 两个链表相加

摘要: 题目描述You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nod... 阅读全文

posted @ 2017-12-26 20:10 sichenzhao 阅读(202) 评论(0) 推荐(0) 编辑

c++-median-of-two-sorted-arrays

摘要: 题目描述There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time c... 阅读全文

posted @ 2017-12-26 16:54 sichenzhao 阅读(149) 评论(0) 推荐(0) 编辑

c++-奇位数丢弃

摘要: 题目描述对于一个由0..n的所有数按升序组成的序列,我们要进行一些筛选,每次我们取当前所有数字中从小到大的第奇数位个的数,并将其丢弃。重复这一过程直到最后剩下一个数。请求出最后剩下的数字。输入描述:每组数据一行一个数字,为题目中的n(n小于等于1000)。输出描述:一... 阅读全文

posted @ 2017-12-26 11:54 sichenzhao 阅读(246) 评论(0) 推荐(0) 编辑

导航