数据结构可视化工具

提示:文章

文章目录

前言

前期疑问:

本文目标:


一、背景

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

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


总结

未完待续

相关推荐
学嵌入式的小杨同学3 小时前
【嵌入式 C 语言实战】手动实现字符串四大核心函数(strcpy/strcat/strlen/strcmp)
c语言·开发语言·前端·javascript·数据结构·数据库·算法
人工干智能3 小时前
Pandas核心数据结构:Series与DataFrame
数据结构·python·pandas
Yolo_TvT3 小时前
数据结构:初识“树”
数据结构
信奥卷王3 小时前
2025年9月GESPC++四级真题解析(含视频)
数据结构·c++·算法
jimy14 小时前
创建链表注意项(三):使用内存池减少malloc开销(用标志位或空闲链表)
数据结构·链表
源代码•宸4 小时前
Golang原理剖析(Sync.Map)
数据结构·经验分享·后端·golang·sync.map·readmap·dirtymap
Cher ~4 小时前
【数据结构】stl 容器
开发语言·数据结构·c++
uoKent4 小时前
c++中的初始化列表
数据结构·c++
alonewolf_994 小时前
Redis 7 核心数据结构指南:从基础到实战应用
数据结构·redis·分布式架构