Introduction to Data Structure and Algorithms

Slides:



Advertisements
Similar presentations
Lists, Stacks, Queues Svetlin Nakov Telerik Corporation
Advertisements

Computational Geometry
Computer Science 112 Fundamentals of Programming II Overview of Collections.
CS252: Systems Programming Ninghui Li Program Interview Questions.
CS Data Structures II Review COSC 2006 April 14, 2017
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Computational Complexity 1. Time Complexity 2. Space Complexity.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
CS 206 Introduction to Computer Science II 11 / 12 / 2008 Instructor: Michael Eckmann.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 – Data Structures Outline 12.1Introduction.
Data Structures, Spring 2004 © L. Joskowicz 1 DAST – Final Lecture Summary and overview What we have learned. Why it is important. What next.
Important Problem Types and Fundamental Data Structures
Chapter 1 Introduction Definition of Algorithm An algorithm is a finite sequence of precise instructions for performing a computation or for solving.
Lists, Stacks, Queues Svetlin Nakov Telerik Corporation
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Thurs.
Comp 249 Programming Methodology Chapter 15 Linked Data Structure - Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
1 Hash Tables  a hash table is an array of size Tsize  has index positions 0.. Tsize-1  two types of hash tables  open hash table  array element type.
Review C++ exception handling mechanism Try-throw-catch block How does it work What is exception specification? What if a exception is not caught?
Chapter Complexity of Algorithms –Time Complexity –Understanding the complexity of Algorithms 1.
Data Structures Winter What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important.
Design and Analysis of Algorithms CSC201 Shahid Hussain 1.
ECE 103 Engineering Programming Chapter 61 Abstract Data Types Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 1.
Elementary Data Structures Data Structures and Algorithms A. G. Malamos.
Information and Computer Sciences University of Hawaii, Manoa
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
CS223 Advanced Data Structures and Algorithms 1 Review for Midterm Neil Tang 03/06/2008.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
CS 206 Introduction to Computer Science II 11 / 16 / 2009 Instructor: Michael Eckmann.
Java Methods Big-O Analysis of Algorithms Object-Oriented Programming
3.3 Complexity of Algorithms
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
Queues, Stacks and Heaps. Queue List structure using the FIFO process Nodes are removed form the front and added to the back ABDC FrontBack.
8 January Heap Sort CSE 2011 Winter Heap Sort Consider a priority queue with n items implemented by means of a heap  the space used is.
Heaps and basic data structures David Kauchak cs161 Summer 2009.
CISC220 Fall 2009 James Atlas Dec 07: Final Exam Review.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
Computer Engineering Rabie A. Ramadan Lecture 6.
Data Structures David Kauchak cs302 Spring Data Structures What is a data structure? Way of storing data that facilitates particular operations.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
CS6045: Advanced Algorithms Data Structures. Dynamic Sets Next few lectures will focus on data structures rather than straight algorithms In particular,
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture3.
Week 15 – Monday.  What did we talk about last time?  Tries.
Final Exam Review CS 3358.
CSC317 Selection problem q p r Randomized‐Select(A,p,r,i)
“<Fill in your definition here.>”
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
Chapter 12 – Data Structures
Top 50 Data Structures Interview Questions
Chapter 15 Lists Objectives
Heaps And Priority Queues
Abstraction A tool (concept) to manage complexity
Week 15 – Monday CS221.
Introduction to Algorithms
Dynamic Sets (III, Introduction)
Mutable Data (define mylist (list 1 2 3)) (bind ((new (list 4)))
Introduction to Data Structures
EE 312 Final Exam Review.
Important Problem Types and Fundamental Data Structures
Presentation transcript:

Introduction to Data Structure and Algorithms Chuan-kai Yang

Data Structures Basic Data Types Stack Queue Linked-List Array Heap, Priority Queue Binary Search Tree Hash Table

Basic Data Types Character (Byte, Octet) Boolean Integer Float, double Signed or Unsigned Boolean Integer Long or short Float, double String

Stack Interfaces (Allowed Operations) Push Pop If a stack is not full, this adds one element on the top of a stack Pop If a stack is not empty, this removes one element from the top of a stack FILO (First In Last Out)

Queue Interfaces Enqueue Dequeue FIFO (First In First Out) If a queue is not full, add one element at the tail of a queue Dequeue If a queue is not empty, remove one element from the head of a queue FIFO (First In First Out)

Linked-List Singly-linked lists Doubly-linked lists Circular-linked lists Search, Insert, Delete

Array 1 2 3 4 5 6 7 8 9 1 10 9 6 7 5 3 2 9

Heap Max_Extract, Insert, Delete

Binary Search Tree Search, Insert, Delete, Successor, Predecessor

Hash Table

Hash Table – Chaining

Hash Table – Open Addressing

Algorithms What is algorithm? Time Complexity & Space Complexity Growth of Functions Recurrence relation Sorting Searching Graph Algorithm Computational Geometry

What is Algorithms Algorithm: Any well-defined computation procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. Or: tool for solving well specific computational problem. Example: Sorting problem Input: A sequence of n numbers Output: A permutation of the input sequence such that .

Time & Space Complexity Time complexity Time to run an algorithm Worst-Case, Best-Case, Average-Case Space complexity (Memory) Capacity to run an algorithm

Growth of Functions Log < polynomial < exponential Constant time: c Logarithmic time: log(n) Linear time: cn Quadratic time: cn2 Exponential time: cn

Recurrence Relation merge_sort(A, p, q) { merge_sort(A, p, (p+q)/2); merge_sort(A, (p+q)/2+1, q); merge(A, p, q); } T(n)=2T(n/2)+O(n)

Sorting Insertion Sort Selection Sort Quick Sort Counting Sort

Searching Method Finding what? Linear Search Binary Search Hash Search If a data structure has some element Finding the n-th smallest element Finding the successor/predecessor

Graph Algorithm Minimal Spanning Tree Shortest Path Euler Path/Cycle Hamiltonian path/Cycle Travelling salesman

Minimal Spanning Tree

Shortest Path

Euler Path/Cycle

Hamiltonian Path/Cycle

Traveling-Salesman Problem

Computational Geometry Line-segment intersection Convex hull Voronoi diagram

Convex Hull

Voronoi Diagram