REBOL Lists.

Slides:



Advertisements
Similar presentations
Singly linked lists Doubly linked lists
Advertisements

Singly Linked Lists What is a singly-linked list? Why linked lists?
David Weinberg presents Linked Lists: The Background  Linked Lists are similar to ArrayLists in their appearance and method of manipulation  They do.
Data Structures & Algorithms
Binary Search Visualization i j.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 17: Linked Lists.
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
CS 206 Introduction to Computer Science II 09 / 19 / 2008 Instructor: Michael Eckmann.
CSE 131 Computer Science 1 Module 9: Linked Lists Using references to link objects Basic operations on linked lists Implementing a linked list of integers.
HIT2037- HIT6037 Software Development in Java 22 – Data Structures and Introduction.
Linked List by Chapter 5 Linked List by
Subject Name : Data Structure Using C Title : Linked Lists
1 CS162: Introduction to Computer Science II Abstract Data Types.
Linked Lists Source: presentation based on notes written by R.Kay, A. Hill and C.Noble ● Lists in general ● Lists indexed using pointer arrays ● Singly.
Linked Data Structures
Chapter 16: Linked Lists.
Lecture 6 of Computer Science II
Cpt S 122 – Data Structures Abstract Data Types
Data Structure By Amee Trivedi.
Vectors 5/31/2018 9:25 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and.
Sorted Linked List Same objective as a linked list, but it should be sorted Sorting can be custom according to the type of nodes Offers speedups over non-sorted.
Sequences 6/3/2018 9:11 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
CMSC202 Computer Science II for Majors Lecture 12 – Linked Lists
Linked List Stacks, Linked List Queues, Dequeues
Linked Lists Linked Lists 1 Sequences Sequences 07/25/16 10:31
Doubly Linked List Review - We are writing this code
UNIT-3 LINKED LIST.
Sequences 8/2/ :13 AM Linked Lists Linked Lists.
Linked List Variations
Sequences 8/2/ :16 AM Linked Lists Linked Lists.
Algorithm for deleting a node from a singly linked list
EEL 4854 IT Data Structures Linked Lists
Binary Search one reason that we care about sorting is that it is much faster to search a sorted list compared to sorting an unsorted list the classic.
Programmazione I a.a. 2017/2018.
LINKED LISTS CSCD Linked Lists.
Prof. Neary Adapted from slides by Dr. Katherine Gibson
Linked Lists.
Circularly Linked Lists
Sequences 11/22/2018 3:25 AM Doubly-Linked Lists Doubly-Linked Lists.
Doubly linked lists Idea: same as singly linked list, but each node also points to the previous: Can optionally also have a pointer to the tail, so we.
كيــف تكتـب خطـة بحـث سيئـة ؟؟
الدكتـور/ عبدالناصـر محمـد عبدالحميـد
Sequences 11/27/2018 1:37 AM Singly Linked Lists Singly Linked Lists.
Lecture 20 Linked Lists Richard Gesick.
كار همراه با آسودگي و امنيت
Linked Lists.
Sequences 12/8/2018 3:02 AM Linked Lists Linked Lists.
11-3 LINKED LISTS A linked list is a collection of data in which each element contains the location of the next element—that is, each element contains.
CS212D: Data Structures Week 5-6 Linked List.
CS2013 Lecture 4 John Hurley Cal State LA.
Doubly Linked Lists Lecture 21 Tue, Mar 21, 2006.
Linked Lists in C and C++
Problem Understanding
LINKED LISTS.
CS210- Lecture 5 Jun 9, 2005 Agenda Queues
Lecture 16 Section 6.2 Thu, Mar 1, 2007
Linked Lists.
Separation Logic (III)
CS210- Lecture 6 Jun 13, 2005 Announcements
Programming II (CS300) Chapter 07: Linked Lists
Linked Lists.
Linked Lists.
More on Linked List Yumei Huo Department of Computer Science
BY PROF. IRSHAD AHMAD LONE.
Chapter 9 Linked Lists.
Jyh-Shing Roger Jang (張智星) CSIE Dept, National Taiwan University
CMPT 225 Lecture 5 – linked list.
Stacks and Linked Lists
Problem Understanding
Presentation transcript:

REBOL Lists

REBOL does it differently Other languages: Lists (and similar sequences) are singly-linked head returns the first element of the series tail returns the remainder of the series, minus the head REBOL: Series are doubly-linked, hence traversable in either direction Any reference to a series is a reference to some position in the series head returns the beginning of the series tail returns the end of the series

Traversing a sequence head returns the beginning of the sequence tail returns the end of the sequence next returns the next position in the sequence If already at the tail, returns the tail back returns the previous position in the sequence If already at the head, returns the head head? tests if a position is the beginning of a sequence tail? tests if a position is the end of a sequence

Example traversals >> str: "REBOL" == "REBOL" >> mid: next next str == "BOL" >> head? mid == false >> head mid == "REBOL" >> end: tail str == "" >> back end == "L"

Getting elements from a sequence >> str: "REBOL" == "REBOL" >> first str == #"R" >> second str == #"E" >> last str == #"L" >> pick str 4 == #"O" >> pick str 8 == none

Indexing into a sequence >> str: "REBOL" == "REBOL" >> index? str == 1 >> mid: at str 3 == "BOL" >> at mid 2 == "OL” >> at mid -1 == "EBOL" >> index? at mid -1 == 2

The End