Data Structures Evolution of algorithms for an array-based stack, queue, and linked-list. Evolved data structures used to evolve solutions to problems.

Slides:



Advertisements
Similar presentations
Stacks, Queues, and Linked Lists
Advertisements

1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 7- 1 Overview 7.1 Introduction to Arrays 7.2 Arrays in Functions 7.3.
Stacks, Queues, and Deques. 2 A stack is a last in, first out (LIFO) data structure Items are removed from a stack in the reverse order from the way they.
Stacks  a data structure which stores data in a Last-in First-out manner (LIFO)  has a pointer called TOP  can be implemented by either Array or Linked.
Data Structure Dr. Mohamed Khafagy.
Stacks, Queues, and Deques
Chapter 3 Stacks.
Stacks CS-240 Dick Steflik. Stacks Last In, First Out operation - LIFO As items are added they are chronologically ordered, items are removed in reverse.
Stacks CS-240 Dick Steflik. Stacks Last In, First Out operation - LIFO As items are added they are chronologically ordered, items are removed in reverse.
Lecture 6 Feb 12 Goals: stacks Implementation of stack applications Postfix expression evaluation Convert infix to postfix.
Main Index Contents 11 Main Index Contents Model for a Queue Model for a Queue The Queue The Queue ADTQueue ADT (3 slides) Queue ADT Radix Sort Radix Sort.
Data Structures from Cormen, Leiserson, Rivest & Stein.
Stacks CS-240 & CS-341 Dick Steflik. Stacks Last In, First Out operation - LIFO As items are added they are chronologically ordered, items are removed.
Stacks, Queues, and Deques
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.
Stacks, Queues, and Deques. A stack is a last in, first out (LIFO) data structure –Items are removed from a stack in the reverse order from the way they.
Stacks, Queues, and Deques
CHAPTER 3 : STACKS 3.1 Understand Stacks 3.2 Implement the operation of stack By : Suzila Yusof.
Ali Abdul Karem Habib Kufa University / mathematics & Science Of Computer.
Sorting, Stacks, Queues Bryce Boe 2013/11/06 CS24, Fall 2013.
Objectives of these slides:
Data Structures Using C++ 2E Chapter 7 Stacks. Data Structures Using C++ 2E2 Objectives Learn about stacks Examine various stack operations Learn how.
Comp 245 Data Structures Stacks. What is a Stack? A LIFO (last in, first out) structure Access (storage or retrieval) may only take place at the TOP NO.
Implementing Stacks Ellen Walker CPSC 201 Data Structures Hiram College.
Stack and Queue.
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
DATA STRUCTURE & ALGORITHMS CHAPTER 3: STACKS. 2 Objectives In this chapter, you will: Learn about stacks Examine various stack operations Discover stack.
DATA STRUCTURES AND ALGORITHMS Lecture Notes 4 Prepared by İnanç TAHRALI.
 STACK STACK  BASIC STACK OPERATIONS BASIC STACK OPERATIONS  PUSH ALGORITHM PUSH ALGORITHM  POP ALGORITHM POP ALGORITHM  EVALUATING A POSTFIX EXPRESSION.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
Arrays An array is a data structure that consists of an ordered collection of similar items (where “similar items” means items of the same type.) An array.
C++ STL CSCI 3110.
30 May Stacks (5.1) CSE 2011 Winter Stacks2 Abstract Data Types (ADTs) An abstract data type (ADT) is an abstraction of a data structure An.
Data structures Abstract data types Java classes for Data structures and ADTs.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 3.
Stacks and Queues Based on D.S. Malik, Java Programming: Program Design Including Data Structures.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 18: Stacks and Queues.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 19: Stacks and Queues.
Stack Any Other Data Structure Array Linked List
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 18: Stacks and Queues.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 18: Stacks and Queues (part 2)
Scis.regis.edu ● CS-362: Data Structures Week 8 Dr. Jesús Borrego 1.
3 Data. Software And Data Data Data element – a single, meaningful unit of data. Name Social Security Number Data structure – a set of related data elements.
Advanced Higher Computing Science Stacks Queues and linked lists.
Heaps and basic data structures David Kauchak cs161 Summer 2009.
CHP-3 STACKS.
Definition: A stack is an ordered collection of elements in which insertions(Push) and deletions(Pop) are restricted to one end. LIFO(Last In First Out)
Introduction Genetic programming falls into the category of evolutionary algorithms. Genetic algorithms vs. genetic programming. Concept developed by John.
+ Arrays & Random number generator. + Introduction In addition to arrays and structures, C supports creation and manipulation of the following data structures:
Stacks & Queues. Introduction to Stacks and Queues Widely used data structures Ordered List of element Easy to implement Easy to use.
Copyright © Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Java From Control Structures through Data Structures by Tony.
Data Structures David Kauchak cs302 Spring Data Structures What is a data structure? Way of storing data that facilitates particular operations.
“The desire for safety stands against every great and noble enterprise.” – Tacitus Thought for the Day.
Blocks World Problem. The CS Terminal Specifies the block at the top of the stack. Example CS evaluates to E Note: Evaluates to nil if the stack is empty.
M180: Data Structures & Algorithms in Java Stacks Arab Open University 1.
Stack. ADS2 Lecture 1010 The Stack ADT (GoTa §5.1) The Stack ADT stores arbitrary objects Insertions and deletions follow the last-in.
Click to edit Master text styles Stacks Data Structure.
1 Stacks Abstract Data Types (ADTs) Stacks Application to the analysis of a time series Java implementation of a stack Interfaces and exceptions.
Stacks Chapter 3 Objectives Upon completion you will be able to
Evolving Recursive Algorithms The SRF function Automatically defined recursions (ADRs) The recur operator Dealing with infinite and time-consuming recursions.
STACKS & QUEUES for CLASS XII ( C++).
Data Structures Using C++ 2E
Stacks and Queues Chapter 4.
Stacks and Queues.
Stacks.
CMSC 341 Lecture 5 Stacks, Queues
Stacks Data structure Elements added, removed from one end only
Stacks CS-240 Dick Steflik.
LINEAR DATA STRUCTURES
Presentation transcript:

Data Structures Evolution of algorithms for an array-based stack, queue, and linked-list. Evolved data structures used to evolve solutions to problems. GP system performed better than the standard GP system with indexed memory.

The Push-Down Stack The push-down stack is an array-based stack. The first element pushed onto the stack stored in the array at the position equal to the maximum size of the stack. As successive elements are added onto the stack the stack pointer is decremented by one.

Stack Operations makenull - The stack pointer is assigned the value of the maximum size of the stack plus one so as to indicate that the stack is empty. empty - If the value of the stack pointer is not validthis method returns true otherwise it returns false. top - A copy of the element at the top of the stack is returned. pop - This method returns the element currently pointed to by the stack pointer, and increments the stack pointer by one. push - This method reduces the stack pointer by one and stores the element passed to it at this position.

The Genetic Programming System Objective: To simultaneously evolve the five algorithms for an integer, array-based push-down stack. Checks for stack overflow and underflow are not catered for. Each individual in the population is represented using a multi-tree genome. The genome consists of five parse trees representing each of the five stack operations. Primitives Constants: 0, 1 max : The maximum size of the stack. This is given a value of 10. arg1: The value to be pushed onto the stack. Arithmetic operators: +, - read and write aux, inc_aux, dec_aux and write_aux

The Genetic Programming System Fitness Cases: Four test sequences were used. Each test sequence consists of 40 calls to each of the five stack operations and requires a value to be returned at the end of each function call. The values pushed onto the stack were randomly selected in the range The number of function calls for which the same value is returned for each function call. The operations makenull and push are indirectly tested as they do not return a value. The score is automatically incremented by one for both these operations. Trees accessing an invalid memory location are penalised by stopping the evaluation and returning the fitness value calculated up until that point.

The Genetic Programming System Selection: Tournament selection with a tournament size of 4. Population Size: 1000 Generations: 101 Program Size: <= 250 Success Predicate: Fitness >= 160

Evolved Solution