数据结构可视化工具

提示:文章

文章目录

前言

前期疑问:

本文目标:


一、背景

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

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


总结

未完待续

相关推荐
聆风吟º10 小时前
【数据结构手札】空间复杂度详解:概念 | 习题
java·数据结构·算法
not coder11 小时前
树形结构,从零到工业级评论系统
数据结构
smj2302_7968265213 小时前
解决leetcode第3801题合并有序列表的最小成本
数据结构·python·算法·leetcode
sinat_2554878114 小时前
InputStream/OutputStream小讲堂
java·数据结构·算法
副露のmagic15 小时前
更弱智的算法学习 day16
数据结构·学习·算法
Love Song残响16 小时前
30字高效MATLAB优化指南
数据结构·算法
sin_hielo16 小时前
leetcode 1975
数据结构·算法·leetcode
cpp_250116 小时前
P1583 魔法照片
数据结构·c++·算法·题解·洛谷
无限进步_16 小时前
【C语言】堆排序:从堆构建到高效排序的完整解析
c语言·开发语言·数据结构·c++·后端·算法·visual studio
鱼跃鹰飞17 小时前
面试题:树形结构演进与核心问题解决方案
数据结构·b树·散列表