Data Structures & Algorithms What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO CS16 CS16: Introduction to Algorithms and Data Structures Tu/Th 10:30-11:50 Metcalf Auditorium David Laidlaw Thursday, January 23, 2014.
Advertisements

Exam Review 3 Chapters 10 – 13, 15 CSC212 Section FG CS Dept, CCNY.
MATH 224 – Discrete Mathematics
Garfield AP Computer Science
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
Divide And Conquer Distinguish between small and large instances. Small instances solved differently from large ones.
Analysis & Design of Algorithms (CSCE 321)
Advanced Data Structures Sartaj Sahni
CS203 Programming with Data Structures Sorting California State University, Los Angeles.
CSE332: Data Abstractions Lecture 12: Introduction to Sorting Tyler Robison Summer
CSCE 210 Data Structures and Algorithms
Data Structures & Algorithms Richard Newman Clip Art Sources s s s s
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
CSCE156: Introduction to Computer Science II Instructor Stephen Scott Website
Midterm Exam Two Tuesday, November 25 st In class cumulative.
Time Complexity s Sorting –Insertion sorting s Time complexity.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Value Iteration 0: step 0. Insertion Sort Array index67 Iteration i. Repeatedly swap element i with.
Simple Sort Algorithms Selection Sort Bubble Sort Insertion Sort.
Analysis and Design of Algorithms An algorithm is a method of solving problem (on a computer) Problem example: –given a set of points on the plane –find.
Fall 2013 Instructor: Reza Entezari-Maleki Sharif University of Technology 1 Fundamentals of Programming Session 17 These.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
COP 3530: Data Structures, Algorithms, & Applications Instructor: Kristian Linn Damkjer.
Data Structures, Algorithms, & Applications
1 CS 233 Data Structures and Algorithms 황승원 Fall 2010 CSE, POSTECH.
BIM213 – Data Structures and Algorithms Introduction 1.
COMPE 574 Fundamentals of Algorithms Spring Murat KARAKAYA Department of Computer Engineering.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Fall 2013 Instructor: Reza Entezari-Maleki Sharif University of Technology 1 Fundamentals of Programming Session 17 These.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Asymptotic Notation (O, Ω, )
1 Week 9 A little more GUI, and threads. Objectives: Discuss the Swing set of classes. Incorporate animation into applets. Define the term thread. Explain.
December 4, Algorithms and Data Structures Lecture XV Simonas Šaltenis Aalborg University
Data Structures for Programmers Vamshi Ambati
Sorting – Insertion and Selection. Sorting Arranging data into ascending or descending order Influences the speed and complexity of algorithms that use.
Survey of Sorting Ananda Gunawardena. Naïve sorting algorithms Bubble sort: scan for flips, until all are fixed Etc...
2011-T2 Lecture 21 School of Engineering and Computer Science, Victoria University of Wellington  Marcus Frean, Lindsay Groves, and Peter Andreae, VUW.
Data Structures Engr. Umbreen sabir What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.
Chapter 5 Algorithms (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Final Exam Tuesday, December 22nd 2:00 - 3:50pm room 102 Warren Weaver Hall.
Sorting and Searching by Dr P.Padmanabham Professor (CSE)&Director
Data Structures for Midterm 2. C++ Data Structure Runtimes.
CSS446 Spring 2014 Nan Wang.  to study trees and binary trees  to understand how binary search trees can implement sets  to learn how red-black trees.
Data Structures and Algorithms Dr. Manuel E. Bermudez Alter ego to Dr. Sartaj Sahni.
Data Structures, Algorithms, & Applications Instructor: Babak Alipour Slides and book: Sartaj Sahni.
CSE332: Data Abstractions Lecture 12: Introduction to Sorting Dan Grossman Spring 2010.
Data Structures and Algorithms in Java AlaaEddin 2012.
Today’s Material Sorting: Definitions Basic Sorting Algorithms
Algorithms Design and Analysis CS Course description / Algorithms Design and Analysis Course name and Number: Algorithms designs and analysis –
Data Structures Dai Tian-Shyr
Lecture 2. Algorithms and Algorithm Convention 1.
Data Structures, Algorithms, & Applications
Final Exam Review COP4530.
CSCE 210 Data Structures and Algorithms
Data Structures, Algorithms, & Applications
Midterm Review.
CS 315 Data Structures B. Ravikumar Office: 116 I Darwin Hall Phone:
Exam Hints.
Data Structures, Algorithms, & Applications
Objective of This Course
Final Exam Review COP4530.
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
Data Structures, Algorithms, & Applications
Sorting And Searching CSE116A,B 2/22/2019 B.Ramamurthy.
Sorting Rearrange a[0], a[1], …, a[n-1] into ascending order.
Algorithms Lecture #07 Dr.Sohail Aslam.
Presentation transcript:

Data Structures & Algorithms

What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs manipulate data. s So, all programs represent data in some way. s Data manipulation requires an algorithm.

What The Course Is About We shall study ways to represent data and algorithms to manipulate these representations. The study of data structures is fundamental to Computer Science & Engineering.

Functions of Data Structures s Add –Index –Key –Position –Priority s Get s Change s Delete

Common Data Structures s Array s Stack s Queue s Linked List s Tree s Heap s Hash Table s Priority Queue

How many Algorithms? s Countless

Algorithm Strategies s Greedy s Divide and Conquer s Dynamic Programming s Exhaustive Search s Approximation Algorithms s Randomized Algorithms

Which Data Structure or Algorithm is better? s Must Meet Requirement s High Performance s Low RAM footprint s Easy to implement –Encapsulated

Prerequisites s Asymptotic Complexity  Big Oh, Theta, and Omega notations sCsC

Web Site s programming.im.ncnu.edu.tw s 管 5047 s Handouts, syllabus, text, source codes, exercise solutions, lectures, assignments, past exams, past exam solutions, TAs, etc.

Assignments s Moodle.ncnu.edu.tw s Assignment guidelines

Sorting s Rearrange a[0], a[1], …, a[n-1] into ascending order. When done, a[0] <= a[1] <= … <= a[n-1] s 8, 6, 9, 4, 3 => 3, 4, 6, 8, 9

Sort Methods s Insertion Sort s Bubble Sort s Selection Sort s Count Sort s Shaker Sort s Shell Sort s Heap Sort s Merge Sort s Quick Sort

Insert An Element s Given a sorted list/sequence, insert a new element s Given 3, 6, 9, 14 s Insert 5 s Result 3, 5, 6, 9, 14

Insert an Element s 3, 6, 9, 14 insert 5 s Compare new element (5) and last one (14) s Shift 14 right to get 3, 6, 9,, 14 s Shift 9 right to get 3, 6,, 9, 14 s Shift 6 right to get 3,, 6, 9, 14 s Insert 5 to get 3, 5, 6, 9, 14

Insert An Element /* insert t into a[0:i-1] */ int j; for (j = i - 1; j >= 0 && t < a[j]; j--) a[j + 1] = a[j]; a[j + 1] = t;

Insertion Sort s Start with a sequence of size 1 s Repeatedly insert remaining elements

Insertion Sort s Sort 7, 3, 5, 6, 1 s Start with 7 and insert 3 => 3, 7 s Insert 5 => 3, 5, 7 s Insert 6 => 3, 5, 6, 7 s Insert 1 => 1, 3, 5, 6, 7

Insertion Sort for (i = 1; i < n; i++) {/* insert a[i] into a[0:i-1] */ /* code to insert comes here */ }

Insertion Sort for (i = 1; i < n; i++) {/* insert a[i] into a[0:i-1] */ int t = a[i]; int j; for (j = i - 1; j >= 0 && t < a[j]; j--) a[j + 1] = a[j]; a[j + 1] = t; }