数据结构可视化工具

提示:文章

文章目录

前言

前期疑问:

本文目标:


一、背景

有个数据结构可视化的网址

https://pythontutor.com/render.html#mode=display

二、

2.1

使用pythontutor工具,一打开一个页面看到一个demo,记录一下

cpp 复制代码
#include <iostream>
2	
3	int main() {
4	  int* x = new int[3];
5	  x[1] = 20;
6	  int* p = &x[1]; // pointer into middle
7	  const char** fruit = new const char*[3];
8	  fruit[1] = "bananas";
9	  std::cout << "Yum " << *p << " " << fruit[1];
10	  return 0;
11	}

自己写了个demo

cpp 复制代码
int main() {
  // std::vector<int> vec;
  // vec.push(1);
  // vec.push(2);
  // vec.push(3);
  int c = 0;
  char test[3] = {'\0'};
  char test2[3] = {'a'};
  int array1[3] = {0};
  int array2[3] = {2};
  char ayyay[] = {1, 7, 11, 9, 44};
  int* p = (int*)malloc(5 * sizeof(int));
  return 0;
}

有以下疑问,

难道是array2先入栈的,看是array2地址最大。

array[]没有将5个值全部存储,是系统有自己的处理吗?

函数名会存在栈中吗?

2.2

三、

3.1


总结

未完待续

相关推荐
xiaoye-duck37 分钟前
计数排序:高效非比较排序解析
数据结构
稚辉君.MCA_P8_Java2 小时前
通义 插入排序(Insertion Sort)
数据结构·后端·算法·架构·排序算法
无限进步_3 小时前
C语言动态内存的二维抽象:用malloc实现灵活的多维数组
c语言·开发语言·数据结构·git·算法·github·visual studio
Swift社区3 小时前
LeetCode 432 - 全 O(1) 的数据结构
数据结构·算法·leetcode
芬加达3 小时前
leetcode34
java·数据结构·算法
leoufung4 小时前
链表题目讲解 —— 删除链表的倒数第 n 个节点(LeetCode 19)
数据结构·leetcode·链表
dragoooon344 小时前
[优选算法专题八.分治-归并 ——NO.46~48 归并排序 、数组中的逆序对、计算右侧小于当前元素的个数]
数据结构·算法·排序算法·分治
招摇的一半月亮4 小时前
P2242 公路维修问题
数据结构·c++·算法
JHC0000004 小时前
交换链表中的节点
数据结构·链表