2023暑期DataStructure
文章平均质量分 76
数据结构与相关想法
EricWang1358
这个作者很懒,什么都没留下…
展开
-
Algorithm that do not use comparison to sort, time complexity goes smaller than NlogN
变量用于确定当前正在处理的位(例如,个位、十位、百位等)。,然后取模 10,可以提取出当前位的值。函数用于根据当前位对数组进行排序。原创 2023-10-09 11:59:38 · 40 阅读 · 0 评论 -
C++: 冒泡排序(Bubble Sort)
冒泡排序的时间复杂度是O(n^2),其中n是数组的大小。这意味着排序时间会随着数组大小的增加而增加,因此在大型数据集上效率较低。然而,对于小型数据集来说,冒泡排序是一个简单而易于理解的排序算法。它不断比较相邻的元素,如果它们的顺序不正确,就交换它们的位置。这个过程一直重复,直到没有需要交换的元素为止,排序就完成了。这个过程就像气泡从底部升到表面一样,较轻的珠子会逐渐“浮”到数组的顶部。假设你有一列由数字组成的玻璃珠,这些珠子的重量不同,你希望将它们按照重量从轻到重排列。原创 2023-09-25 17:23:11 · 234 阅读 · 0 评论 -
[DS: 3]Addressing & Array &Sorting
Basics in Computer Memory ordered sequence of bytes unique address key difference between high & low level programming languages whether programmer has to deal with memory addressing directly Numbers Binary Octal (0,1,2,3,4,5,6,7) Hexade原创 2023-07-12 21:24:41 · 40 阅读 · 0 评论 -
[DS:10.2-3]Introduction of BFS and DFS
BFS: 思路:首先遍历所有相邻的顶点 BFS就像是在湖面上扔一块石头,然后观察波纹一圈圈地扩散开来。也就是说,我们首先访问起始节点的所有邻居,然后再访问这些邻居的所有邻居,以此类推。 在代码中,BFS的实现基于队列。 首先,我们将起始节点放入队列并标记为已访问(黑色)。然后,只要队列不为空,我们就从队列中取出一个节点,访问它的所有未访问(白色)的邻居,将这些邻居节点加入队列并标记为已访问。 代码如图 Time Complexity When a原创 2023-07-13 01:45:00 · 38 阅读 · 0 评论 -
[DS:10.1] How to Read Adjacency lists
Adjacency lists 一种顺序与链式相结合的存储结构 表头是一个节点数组,对应图的顶点(什么是顶点?) 每一个节点后链接一个链表或者指针数组,存储与这个顶点相邻的其他顶点的指针(如何理解这里的指针?) 不论是有向图还是无向图,Weighted or not 只要A到B之间有一条边,A后就有一个B的指针 指针的链接表示相连 如果需要表示权重。则可以在表示边的结构中增加额外的数据域存储 顶点 图的顶点(vert原创 2023-07-12 21:21:29 · 34 阅读 · 0 评论 -
[DS:10] Graph 1
Definition Edge : some relation Undirected Graphs G1 Facebook (u,v) Directed Graphs Twitter Each edge will be related (u,v) means u is a source and v is the destination (u,v) != (v,u) Multi-edge(less seen in reality)原创 2023-07-12 21:20:44 · 63 阅读 · 0 评论 -
[10.4] The Code Implementation of BFS and DFS in Graph
【代码】[10.4] The Code Implementation of BFS and DFS in Graph。原创 2023-07-12 20:20:48 · 26 阅读 · 0 评论 -
[DS:3.2]Understanding Java‘s Memory Management and Array Return Mechanism
Grade 1: In Java, an array is an object. All objects, including arrays, are stored in the heap memory. When a function returns an array, it returns a reference (address) to that array. Grade 2: References to objects (like arrays) are stored in the s原创 2023-07-10 01:02:39 · 28 阅读 · 0 评论 -
[DS:3.1]Passing objects (references) versus primitive type (values) as parameters.
【代码】[DS:3.1]Passing objects (references) versus primitive type (values) as parameters.原创 2023-07-10 00:26:11 · 29 阅读 · 0 评论 -
[Data Structure]Q2:Differences between ArrayList and LinkedList .
butbutforsince itsince需要从头到尾遍历列表,导致时间复杂度为O(n)[20, 30]原创 2023-06-11 11:45:57 · 64 阅读 · 0 评论 -
[Data Structure]Q1: What is Automatic memory management in Java language compared to C/C++?
Automatic memory management eliminates many of the common pitfalls(陷阱) associated with manual memory management. The。to detail(非常注意细节) and can be prone to(容易出现) errors like memory leaks or accessing invalid memory locations.原创 2023-06-11 11:24:59 · 39 阅读 · 0 评论 -
[Data Structure]Pre: Java Knowledge
Used for◦…management◦…collection◦…◦ Keywords◦ Methods◦…◦ GUI◦…its。原创 2023-06-08 10:56:46 · 35 阅读 · 0 评论 -
[Data Structure] Pre: Simple recursive procedures
【代码】[Data Structure] Pre: Simple recursive procedures。原创 2023-06-07 20:55:46 · 32 阅读 · 0 评论 -
[Data Structure] Commonly used simple data structures in the Java language.
(关于Array最简单且不易报错的删除元素方式?注意:数组长度也改变了。我们可以设置一个新的函数removeElement来进行此操作,显然,不是很方便。微露出,探出 n.一瞥,偷偷地一看;(计算机)读取数据)原创 2023-06-07 21:42:31 · 65 阅读 · 0 评论 -
Essential Prerequisites for Learning Data Structures
to put sth onto a ship 上船;(endeavor:v.努力,尽力 n.努力,尝试;原创 2023-06-07 20:44:35 · 34 阅读 · 0 评论 -
[Data Structure] Brief Introduction for this course
Textbook:ACM-ICPC。原创 2023-06-07 20:35:55 · 31 阅读 · 0 评论 -
【内容声明】本专栏相关背景
本人为CUHK-SZ本科生一枚,本专栏致力于在学习CSC3100:data structure一课时的拓展思考与研究。部分信息来源于对教授所教授内容的笔记,但大多数还是我进行搜索学习以及部分ChatGPT润色后的内容。CSC3100教授:于天舒教授。Tianshu Yu, 于天舒。原创 2023-06-07 20:25:06 · 38 阅读 · 0 评论 -
[Data Structure] 学习数据结构时的难点概述
Here are some challenging aspects that you may encounter while learning data structures,原创 2023-06-02 01:41:24 · 92 阅读 · 0 评论 -
[ChatGPT]如何充分利用ChatGPT和在线视频教程学习数据结构
学习数据结构是计算机科学和软件工程领域中的关键基础知识之一。它对于开发高效、可靠的软件系统至关重要。在过去,人们通常依靠教科书和学校课程来学习数据结构,但如今,我们有了更多的学习资源可供选择,其中包括ChatGPT和在线视频教程。本文将介绍如何充分利用ChatGPT和在线视频教程来学习数据结构,并提供一些建议和具体操作步骤。原创 2023-06-02 01:24:54 · 920 阅读 · 0 评论