Login
Discover
Waves
Communities
Login
Signup
Topics
#datastructure
Global
Trending
Hot
New
Top
#datastructure
New
Top communities
Create your community
latest #datastructure created topics - older | Ecency
sslinux
golang
8y
Golang编程——选择排序(Select Sort)
选择排序 常见排序方法: 冒泡排序 选择排序 插入排序 快速排序 1.冒泡排序 冒泡排序的(Bubble Sorting)的基本思想是:通过对待排序序列从后向前(从下标较大的元素开始),依次比较相邻元素的排序码,若发现逆序则交换,使排序码较小的元素逐渐从后部移向前部(从下标较大的单元移向下标较小的单元),就像水底下的气泡一样逐渐向上冒。
$ 0.000
2
sslinux
cn
8y
Golang数据结构指乔瑟夫问题(Joseph)
单向环形链表的应用实例: Josephu问题: 设编号为1,2,....n的n个人围坐一圈, 约定编号为k(1<=k<=n)的人从1开始报数,数到m的那个人出列,它的下一位又从1开始报数,数到m的那个人又出列; 以此类推,知道所有人出列为止,由此产生一个出队编号的序列。 提示: 用一个不带头节点的循环链表来处理Josephu问题:
$ 0.000
5
sslinux
cn
8y
Golang Programming Datastructure CircleSingleLink(环形单向链表)
单向环形链表 单向环形链表最经典的问题就是约瑟夫问题(Josephu). Josephu问题: 设编号为1,2,....n的n个人围坐一圈, 约定编号为k(1<=k<=n)的人从1开始报数,数到m的那个人出列,它的下一位又从1开始报数,数到m的那个人又出列; 以此类推,知道所有人出列为止,由此产生一个出队编号的序列。 提示: 用一个不带头节点的循环链表来处理Josephu问题:
sslinux
cn
8y
Golang Programming Datastructure--DoubleLink(双向链表)
双向链表 双向链表的应用实例: 使用带head头的双向链表实现-水浒英雄排行榜管理 单向链表的缺点分析: 单向链表,查找的方向只能是一个方向,而双向链表可以向前或者向后查找; 单向链表不能自我删除,需要靠辅助节点,而双向链表,则可以自我删除,所以前面我们单链表删除节点时,总是找到temp的下一个节点来删除的 。 代码实现: package main import "fmt"
sslinux
cn
8y
Golang Programming Datastructure Single Link(单向链表)
链表 链表是有序的列表; 在内存中的地址可能不是连续的,但在逻辑上是连续的; 可以利用链表来做自己的内存数据库; 单链表的介绍: 一般来说:为了比较好的对单链表进行增删改查的操作,我们都会给他设置一个头节点,头节点的作用主要是用来表示链表头,这个节点本身不存放数据; 单链表应用案例: 案例说明: 使用带head头的单链表实现 - 水浒英雄排行榜管理; 完成对英雄任务的增删改查操作;
sslinux
cn
8y
Golang Programming Datastructure--CircleQueue(环形队列)
数组模拟环形队列 对前面的数组模拟队列的优化,充分利用数组。因此将数组看做是一个环形的。(通过取模的方式来实现即可)。 提醒: 尾索引的下一个为头索引是表示队列满,即将队列容量空出一个作为约定,这个在做判断队列满的时候需要注意[ (tail + 1) % maxSize = head 满] tail == head [空] 分析思路: 1.什么时候表示队列满? (tail + 1) % maxSize
sslinux
golang
8y
Golang Program Dtastructure——SingleQueue
队列(queue) 队列原理:先进先出; 队列是一个有序列表,可以用数组或是链表来实现; 遵循先入先出的原则。即:先存入队列的数据,要先取出。后存入的要后取出; 队列的应用场景: 银行排队叫号; 使用数组模拟队列: 队列本身是有序列表,若使用数组的结构来存储队列的数据,则队列数组的声明如下,其中maxSize是该队列的最大容量。 因为队列的输出、输入是分别从前后端来处理。因此需要两个变量 front
sslinux
golang
8y
Golang Program Datastructure——SparseArray(稀疏数组)
稀疏数组(sparse array) 需求: 编写五子棋程序中,有存盘退出和续上盘的功能; 分析: 因为二维数组的很多值是默认值0,因此记录了很多没有意义的数据 --> 稀疏数组; 稀疏数组基本介绍: 当一个数组中大部分元素为0 ,或者为同一个数值时,可以使用稀疏数组来保存该数组; 稀疏数组的处理方法: 记录数组一共有几行几列,有多少个不同的值;
sslinux
golang
8y
Golang program datastructure introduction
数据结构的介绍: 数据结构是一门研究算法的学科,自从有了编程语言也就有了数据结构。学号数据结构可以编写出更加漂亮,更加有效率的代码; 要学习号数据结构就要多多考虑如何将生活中遇到的问题,用程序去实现解决; 程序的核心 = 数据结构 + 算法 界面 业务逻辑 数据结构和算法的关系:
markgritter
programming
8y
Discard Trees: a data structure for finding nonintersecting combinations
A "discard tree" is a data structure I invented that is keyed by bitvectors representing K-combinations. It permits us to efficiently find all bitvectors that do not intersect with the search
yudong
kr
8y
자바로 배우는 핵심 자료구조와 알고리즘 - 1. 시작하기
처음 소개글: 오늘부터 "자바로 배우는 핵심 자료 구조와 알고리즘"을 시작합니다. 이 연재에서는 책에 있는 내용을 그대로 다루기 보다는 "번역"을 하면서 독자분들께 제가 들려드리고 싶은 내용 위주로 전개합니다. 원서는 CCL 라이센스를 따르고 있습니다. 링크: 1. 책의 소스코드 받기 요즘의 IT서적은 거의 소스 코드를 github에서
yudong
kr
8y
<자바로 배우는 핵심 자료구조와 알고리즘> 연재를 시작합니다
안녕하세요, @yudong 입니다. 제가 이번주 금요일인 6월 1일에 번역 4호인 <자바로 배우는 핵심 자료구조와 알고리즘>을 출간합니다. 컴공 학부 2학년 수준이면 이해할 수 있는 얇고 간결한 책으로 번역하면서도 배운게 많았는데요.. 출간기념 연재를 스팀잇에 시작해볼까합니다. (거의 스팀잇을 접었다가.. @jeaimetu 님의 추천으로 돌아오게
simjaemun2
algorithms
8y
!
Low reputation account with an unverified outbound link, Reveal content
[2017.03.01] 알고리즘 비밀의 문을 열다(ALGORITHMS UNLOCKED) - 토머스 코멘
티스토리에 썼던 내용들을 조금씩 옮기려고 한다... 알고리즘의 바이블로 통하는 [Introduction to Algorithms] (이하 CLRS)의 저자 토머스 코멘이 집필했다. 기존 CLRS 책은 컴퓨터 사이언스 전공자를 위한 책이었다면, 이 책은 다양한 성향을 가진 독자를 생각해서 만든 책이라고 한다. 하지만,
bilal-haider
ruby
8y
Ruby Programming Tutorial - Lesson 32 - Recursion and Binary Trees
In this article we are going to learn about binary Tree data structure Before we go learn it, we should be familiar with Recursion, and recursive methods. so lets learn them first :) What is Recursion
drifter1
programming
9y
Programming - Assembly Stack Datastructure
Hello it's me again! Today, after a long time of not uploading Assembly, even though I said that some Examples will come from time to time, I present you with a Stack Implementation
engrqd
modulation
9y
Modulation
DEFINITION modulation • • • • • • Modulation is the addition of information to an electronic or optical carrier signal. A carrier signal is one with a steady waveform -- constant height (amplitude) and
hirennamera
datastructure
9y
How to start with data structure and algorithm
Most enjoyable way of learning data structures and algorithms is to focus on their applications. For example, start wondering how E-commerce websites can tell you “people who bought this (whatever you
vorticieflux6626
programming
10y
Wikipedia Report--Understanding the Merkel Tree construct in Crytpo-computing
Image: from en.wikipedia.org (google images labeled for re-use) Note: This article is of the form Wikipedia Report and it is a method used to facilitate the assimilation of researched information into
← Latest