数据结构可视化工具

提示:文章

文章目录

前言

前期疑问:

本文目标:


一、背景

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

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


总结

未完待续

相关推荐
Fanxt_Ja3 天前
【LeetCode】算法详解#15 ---环形链表II
数据结构·算法·leetcode·链表
今后1233 天前
【数据结构】二叉树的概念
数据结构·二叉树
散1123 天前
01数据结构-01背包问题
数据结构
消失的旧时光-19433 天前
Kotlinx.serialization 使用讲解
android·数据结构·android jetpack
Gu_shiwww3 天前
数据结构8——双向链表
c语言·数据结构·python·链表·小白初步
苏小瀚3 天前
[数据结构] 排序
数据结构
睡不醒的kun3 天前
leetcode算法刷题的第三十四天
数据结构·c++·算法·leetcode·职场和发展·贪心算法·动态规划
吃着火锅x唱着歌3 天前
LeetCode 978.最长湍流子数组
数据结构·算法·leetcode
Whisper_long3 天前
【数据结构】深入理解堆:概念、应用与实现
数据结构
IAtlantiscsdn3 天前
Redis7底层数据结构解析
前端·数据结构·bootstrap