Algorithms and Data Structures CS-CO-412
|
|
- Gavin Hamilton
- 5 years ago
- Views:
Transcription
1 Algorithms and Data Structures CS-CO-412 David Vernon Professor of Informatics University of Skövde Sweden Algorithms and Data Structures 1 Copyright D. Vernon 2014 Course Outline Motivation & Preview The importance of algorithms & data structures Complexity of algorithms Performance of algorithms Time and space tradeoff Worst case and average case performance Big O notation Recurrence relationships Analysis of complexity of iterative and recursive algorithms Tractable and intractable algorithmic complexity Algorithms and Data Structures 2 Copyright D. Vernon 2014
2 Course Outline Simple searching algorithms Linear search Binary search Simple sorting algorithms Bubblesort Quicksort Abstract Data Types (ADTs) Algorithms and Data Structures 3 Copyright D. Vernon 2014 Course Outline Lists, stacks, and queues ADT specification Array implementation Linked-list implementations Trees Binary trees Binary search trees Depth-first traversals Applications of trees (e.g. Huffman coding) Height-balanced trees (e.g. AVL Trees, Red-Black Trees) Algorithms and Data Structures 4 Copyright D. Vernon 2014
3 Course Outline Priority queues Priority queue data structure Binary heap Heapsort Graphs Graph data structure Breadth-first search traversal Depth-first search traversal Minimum spanning tree (e.g. Prim s and Kruskal s algorithms) Shortest-path algorithms (e.g. Dijkstra s and Floyd s algorithms) Topological sort Algorithms and Data Structures 5 Copyright D. Vernon 2014 Course Outline Algorithmic strategies Brute-force Divide-and-conquer Greedy Dynamic programming Combinatorial Search & Backtracking Combinatorics: subsets and permutations All paths in a graphs Branch-and-bound Algorithms and Data Structures 6 Copyright D. Vernon 2014
4 Motivation & Preview The Importance of Algorithms & Data Structures Algorithms and Data Structures 7 Copyright D. Vernon 2014 Muḥammad ibn Mūsā al-khwārizmī محمد بن موسى الخوارزمي Born approximately 780, died between 835 and 850 Persian mathematician and astronomer from the Khorasan province of present-day Uzbekistan The word algorithm is derived from his name Algorithms and Data Structures 8 Copyright D. Vernon 2014
5 Algorithms and Data Structures 9 Copyright D. Vernon 2014 Algorithms + Data Structures = Programs Niklaus Wirth, 1976 Inventor of Pascal and Modula Inventor programming of languages Pascal and Modula Winner of Turing Award Algorithms and Data Structures 10 Copyright D. Vernon 2014
6 Algorithms + Data Structures = Programs Information Processing: Representation & Transformation Input Output Algorithms and Data Structures 11 Copyright D. Vernon 2014 The So6ware Development Process Computational Modelling System Specifica=on Software Design Problem Iden=fica=on Problem Modelling Requirements Elicia=on Validation Algorithms & Representa=ons Testing: Verification & Evaluation So6ware Coding Waterfall Model Software development life-cycle Algorithms and Data Structures 12 Copyright D. Vernon 2014
7 Marr s Hierarchy of Abstrac)on / Levels of Understanding Framework Computa)onal Theory Representa)on & Algorithm Hardware/So<ware Implementa)on Goal, logic, strategy, model Loose coupling I/O representa)on, transforma)on algorithm Loose coupling Physical realiza)on Algorithms and Data Structures 13 Copyright D. Vernon 2014 Marr s Hierarchy of Abstrac)on / Levels of Understanding Framework Trying to understand percep)on by studying only neurons is like trying to understand bird flight by studying only feathers: it just cannot be done. In order to understand bird flight, we have to understand aerodynamics; only then do the structure of feathers and the different shapes of birds wings make sense Marr, D. Vision, Freeman, Algorithms and Data Structures 14 Copyright D. Vernon 2014
8 Sorting a List Given a sequence of n keys a 1,, a n Computa)onal Theory Representa)on & Algorithm Find the permuta)on (reordering) such that a i a j 1 i, j n Hardware/So<ware Implementa)on Algorithms and Data Structures 15 Copyright D. Vernon 2014 Computa)onal Theory Bubble Sort Sorting a List Representa)on & Algorithm Hardware/So<ware Implementa)on Insertion Sort Quick Sort Merge Sort, Key point: different computational efficiency Algorithms and Data Structures 16 Copyright D. Vernon 2014
9 Computa)onal Theory Representa)on & Algorithm Sorting a List Hardware/So<ware Implementa)on Algorithms and Data Structures 17 Copyright D. Vernon 2014 Computa)onal Theory Representa)on & Algorithm Sorting a List Hardware/So<ware Implementa)on Algorithms and Data Structures 18 Copyright D. Vernon 2014
10 Fourier Transform Computa)onal Theory Representa)on & Algorithm Hardware/So<ware Implementa)on Algorithms and Data Structures 19 Copyright D. Vernon 2014 Computa)onal Theory Representa)on & Algorithm Hardware/So<ware Implementa)on Fourier Transform DFT: Discrete Fourier Transform FFT: Fast Fourier Transform FFTW: Fasted Fourier Transform in the West Key point: different computational efficiency Algorithms and Data Structures 20 Copyright D. Vernon 2014
11 Computa)onal Theory Representa)on & Algorithm Fourier Transform Hardware/So<ware Implementa)on Algorithms and Data Structures 21 Copyright D. Vernon 2014 Computa)onal Theory Representa)on & Algorithm Fourier Transform Hardware/So<ware Implementa)on Algorithms and Data Structures 22 Copyright D. Vernon 2014
12 Marr s Levels of Understanding Framework updated 2012 by T. Poggio Learning & Development Calibra)ng & improving the model Computa)onal Theory CS- AI- 421 Ar)ficial Cogni)ve Systems CS- AI- 422 Machine Learning Representa)on & Algorithm Hardware/So<ware Implementa)on Algorithms and Data Structures 23 Copyright D. Vernon 2014 Marr s Levels of Understanding Framework updated 2012 by T. Poggio Evolu)on Genera)ng new models Learning & Development Calibra)ng & improving the model Computa)onal Theory Representa)on & Algorithm Hardware/So<ware Implementa)on Algorithms and Data Structures 24 Copyright D. Vernon 2014
13 Algorithms and Data- Structures Strategy Difficulty Sample of the core ADS topics from 2-3 standard undergraduate Algorithms and Data- Structures courses Gradually increase the slope of the learning curve Time Algorithms and Data Structures 25 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Difficulty Sample of the core ADS topics from 2-3 standard undergraduate Algorithms and Data- Structures courses Gradually increase the slope of the learning curve Graphs Heapsort Greedy Divide & Conquer Branch & Bound Backtracking Binary heaps Priority queues Height-balanced trees Binary search trees Complexity Searching Sorting ADTs Lists, Stacks, Queues Time Algorithms and Data Structures 26 Copyright D. Vernon 2014
14 Algorithms and Data- Structures Topics Complexity of algorithms: Difficulty Performance of algorithms Big O nota)on Recurrence rela)onships Analysis of complexity Itera)ve and recursive algorithms Tractable, intractable complexity Complexity Time Algorithms and Data Structures 27 Copyright D. Vernon 2014 Use Big O notation to determine an upper bound function g(n) that characterizes how the complexity grows with the size of the data set O(g(n)) e.g. O(n log 2 n) Algorithms and Data Structures 28 Copyright D. Vernon 2014
15 Algorithms and Data Structures 29 Copyright D. Vernon 2014 function/ n Exponential Polynomial n 2 1/10,000 second n 5 2 n n n 1/10 second 1/1000 second 2.8 hours 1/2,500 second 3.2 seconds 1 second 3.3 trillion years 1/400 second 5.2 minutes 35.7 years a 70 digitnumber of centuries 1/100 second 2.8 hours 400 trillion centuries a 185 digitnumber of centuries 9/100 second 28.1 days a 75 digitnumber of centuries a 728 digitnumber of centuries Algorithms and Data Structures 30 Copyright D. Vernon 2014
16 Algorithms and Data Structures 31 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Simple searching algorithms Difficulty linear search O(n) binary search O(log 2 n) Complexity Searching Time Algorithms and Data Structures 32 Copyright D. Vernon 2014
17 A B D F G J K M O P R Algorithms and Data Structures 33 Copyright D. Vernon 2014 A B D F G J K M O P R Algorithms and Data Structures 34 Copyright D. Vernon 2014
18 A B D F G J K M O P R Algorithms and Data Structures 35 Copyright D. Vernon 2014 A B D F G J K M O P R Algorithms and Data Structures 36 Copyright D. Vernon 2014
19 Algorithms and Data- Structures Topics Simple sor)ng algorithms: Difficulty Bubblesort (Itera)ve O(n 2 ) ) Quicksort (Recursive O(n log 2 n) ) Complexity Searching Sorting Time Algorithms and Data Structures 37 Copyright D. Vernon 2014 /* Quicksort: assume A[R] contains a sentinel */ void quicksort (int A[], int L, int R) { int i, j, pivot; if ( R > L) { i = L; j = R; pivot = A[i]; do { while (A[i] <= pivot) i=i+1; while ((A[j] >= pivot) && (j>l)) j=j-1; if (i < j) { exchange(a[i],a[j]); /*between partitions*/ i = i+1; j = j-1; } } while (i <= j); exchange(a[l], A[j]); /* reposition pivot */ quicksort(a, L, j); } } quicksort(a, i, R); /*includes sentinel*/ Algorithms and Data Structures 38 Copyright D. Vernon 2014
20 Algorithms and Data Structures 39 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Abstract Data Types (ADTs) Difficulty Informa)on hiding Encapsula)on Data- hiding Basis for object- orienta)on Complexity Searching Sorting ADTs Time Algorithms and Data Structures 40 Copyright D. Vernon 2014
21 Algorithms and Data- Structures Topics Difficulty David Parnas Advisory Board Innopolis University Complexity Searching Sorting ADTs Time Algorithms and Data Structures 41 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Lists, Stacks, and Queues Difficulty ADT specifica)on Array implementa)on Linked- list implementa)on Complexity Searching Sorting ADTs Lists, Stacks, Queues Time Algorithms and Data Structures 42 Copyright D. Vernon 2014
22 Example of List manipula6on w = Next(Last(L),L) Insert(e,w,L) w = Previous(w,L) Delete(w,L) Algorithms and Data Structures 43 Copyright D. Vernon 2014 Header node List element pointer NULL pointer Algorithms and Data Structures 44 Copyright D. Vernon 2014
23 temp List window To delete a node at this window position we re-arrange the links and free the node Algorithms and Data Structures 45 Copyright D. Vernon 2014 Algorithms and Data Structures 46 Copyright D. Vernon 2014
24 Head Tail Head Tail Algorithms and Data Structures 47 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Trees Difficulty Binary trees Binary search trees Depth- first traversal Breadth- first traversals Applica)ons of trees (e.g. Huffman coding) Height- balanced trees (e.g. AVL Trees, Red- Black Trees) Height-balanced trees Binary search trees Complexity Searching Sorting ADTs Lists, Stacks, Queues Time Algorithms and Data Structures 48 Copyright D. Vernon 2014
25 Algorithms and Data Structures 49 Copyright D. Vernon 2014 Sun Mon Tue Fri Sat Thur Wed Binary Search Tree Algorithms and Data Structures 50 Copyright D. Vernon 2014
26 Pointer Implementation Algorithms and Data Structures 51 Copyright D. Vernon C A B D E F G Inorder Traversal Algorithms and Data Structures 52 Copyright D. Vernon 2014
27 AVL Trees Height Balancing +2 A 0 B +1 B A R B L 0 A B L B R B R A R Algorithms and Data Structures 53 Copyright D. Vernon 2014 AVL Trees - RL rotation - 2 A 0 C A L B A 0 B - 1 C B L A L C L C R B L C L C R Algorithms and Data Structures 54 Copyright D. Vernon 2014
28 Red-Black Height-balanced Trees Algorithms and Data Structures 55 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Priority queues, heaps, graphs: Difficulty Topological sort Minimum spanning tree (e.g. Prim s and Kruskal s) Shortest- path algorithms (e.g. Dijkstra s & Floyd s) Graphs Heapsort Binary heaps Priority queues Height-balanced trees Binary search trees Complexity Searching Sorting ADTs Lists, Stacks, Queues Time Algorithms and Data Structures 56 Copyright D. Vernon 2014
29 Adjacency matrix and list implementa)ons of a graph Algorithms and Data Structures 57 Copyright D. Vernon 2014 Algorithms and Data Structures 58 Copyright D. Vernon 2014
30 Minimum Spanning Trees Tree formed from subset of graph edges that connects all ver)ces and minimizes the total path length Algorithms and Data Structures 59 Copyright D. Vernon 2014 Minimum Spanning Tree Shortest Path from Centre Spanning Tree Algorithms and Data Structures 60 Copyright D. Vernon 2014
31 Algorithms and Data Structures 61 Copyright D. Vernon 2014 Algorithms and Data- Structures Topics Difficulty Algorithmic strategies Brute- force Divide- and- conquer Greedy algorithms Combinatorial Search & Backtracking Branch- and- bound Greedy Divide & Conquer Graphs Heapsort Branch & Bound Backtracking Binary heaps Priority queues Height-balanced trees Binary search trees Complexity Searching Sorting ADTs Lists, Stacks, Queues Time Algorithms and Data Structures 62 Copyright D. Vernon 2014
32 Combinatorial Search and Heuris)c Methods Algorithms and Data Structures 63 Copyright D. Vernon 2014 Typical Input for HCP Hamiltonian cycle for the graph Another Hamiltonian cycle for the same graph in A Hamiltonian cycle for a given graph G=(V, E) consists on finding an ordering of the ver)ces of the graph G such that each vertex is visited exactly once Algorithms and Data Structures 64 Copyright D. Vernon 2014
33 Travelling Salesman Problem or, a variant, the vehicle rou)ng problem Algorithms and Data Structures 65 Copyright D. Vernon 2014 See for online resources Algorithms and Data Structures 66 Copyright D. Vernon 2014
34 ` Algorithms and Data-Structures The foundation of all solutions to computational information processing problems Often unseen, but always there Algorithms and Data Structures hpp:// towing- drinking- water/ 67 Copyright D. Vernon 2014 Marr s Hierarchy of Abstrac)on / Levels of Understanding Framework Computa)onal Theory Goal, logic, strategy, model Representa)on & Algorithm I/O representa)on, transforma)on algorithm Hardware/So<ware Implementa)on Physical realiza)on Algorithms and Data Structures 68 Copyright D. Vernon 2014
Introduction to Algorithms Third Edition
Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Introduction to Algorithms Third Edition The MIT Press Cambridge, Massachusetts London, England Preface xiü I Foundations Introduction
More informationTable of Contents. Chapter 1: Introduction to Data Structures... 1
Table of Contents Chapter 1: Introduction to Data Structures... 1 1.1 Data Types in C++... 2 Integer Types... 2 Character Types... 3 Floating-point Types... 3 Variables Names... 4 1.2 Arrays... 4 Extraction
More informationThomas H. Cormen Charles E. Leiserson Ronald L. Rivest. Introduction to Algorithms
Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Introduction to Algorithms Preface xiii 1 Introduction 1 1.1 Algorithms 1 1.2 Analyzing algorithms 6 1.3 Designing algorithms 1 1 1.4 Summary 1 6
More informationAnalysis of Algorithms
Second Edition Design and Analysis of Algorithms Prabhakar Gupta Vineet Agarwal Manish Varshney Design and Analysis of ALGORITHMS SECOND EDITION PRABHAKAR GUPTA Professor, Computer Science and Engineering
More informationVirtual University of Pakistan
Virtual University of Pakistan Department of Computer Science Course Outline Course Instructor Dr. Sohail Aslam E mail Course Code Course Title Credit Hours 3 Prerequisites Objectives Learning Outcomes
More informationDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK Module 1 OBJECTIVE: Algorithms play the central role in both the science and the practice of computing. There are compelling reasons to study algorithms.
More informationDEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: CS6402- Design & Analysis of Algorithm Year/Sem : II/IV UNIT-I INTRODUCTION
Chendu College of Engineering & Technology (Approved by AICTE, New Delhi and Affiliated to Anna University) Zamin Endathur, Madurantakam, Kancheepuram District 603311 +91-44-27540091/92 www.ccet.org.in
More informationECE250: Algorithms and Data Structures Final Review Course
ECE250: Algorithms and Data Structures Final Review Course Ladan Tahvildari, PEng, SMIEEE Professor Software Technologies Applied Research (STAR) Group Dept. of Elect. & Comp. Eng. University of Waterloo
More informationData Structures and Algorithm Analysis in C++
INTERNATIONAL EDITION Data Structures and Algorithm Analysis in C++ FOURTH EDITION Mark A. Weiss Data Structures and Algorithm Analysis in C++, International Edition Table of Contents Cover Title Contents
More informationData Structures and Algorithms for Engineers
04-630 Data Structures and Algorithms for Engineers David Vernon Carnegie Mellon University Africa vernon@cmu.edu www.vernon.eu Data Structures and Algorithms for Engineers 1 Carnegie Mellon University
More informationOverview of Data Structures, Algorithm Analysis
SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : Advanced Data structures and Algorithms (16CS5804) Year & Sem: M.Tech
More informationAnany Levitin 3RD EDITION. Arup Kumar Bhattacharjee. mmmmm Analysis of Algorithms. Soumen Mukherjee. Introduction to TllG DCSISFI &
Introduction to TllG DCSISFI & mmmmm Analysis of Algorithms 3RD EDITION Anany Levitin Villa nova University International Edition contributions by Soumen Mukherjee RCC Institute of Information Technology
More informationLecture 1. Introduction
Lecture 1 Introduction 1 Lecture Contents 1. What is an algorithm? 2. Fundamentals of Algorithmic Problem Solving 3. Important Problem Types 4. Fundamental Data Structures 2 1. What is an Algorithm? Algorithm
More informationCourse Review for Finals. Cpt S 223 Fall 2008
Course Review for Finals Cpt S 223 Fall 2008 1 Course Overview Introduction to advanced data structures Algorithmic asymptotic analysis Programming data structures Program design based on performance i.e.,
More informationPROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)
B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2009 EC 2202 DATA STRUCTURES AND OBJECT ORIENTED Time: Three hours PROGRAMMING IN C++ Answer ALL questions Maximum: 100 Marks 1. When do we declare a
More informationDepartment of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I
MCA 312: Design and Analysis of Algorithms [Part I : Medium Answer Type Questions] UNIT I 1) What is an Algorithm? What is the need to study Algorithms? 2) Define: a) Time Efficiency b) Space Efficiency
More informationIntroduction to Computer Science
Introduction to Computer Science CSCI 109 Readings St. Amant, Ch. 4, Ch. 8 China Tianhe-2 Andrew Goodney Spring 2018 An algorithm (pronounced AL-go-rithum) is a procedure or formula for solving a problem.
More informationCS 445: Data Structures Final Examination: Study Guide
CS 445: Data Structures Final Examination: Study Guide Java prerequisites Classes, objects, and references Access modifiers Arguments and parameters Garbage collection Self-test questions: Appendix C Designing
More informationEnd-Term Examination Second Semester [MCA] MAY-JUNE 2006
(Please write your Roll No. immediately) Roll No. Paper Code: MCA-102 End-Term Examination Second Semester [MCA] MAY-JUNE 2006 Subject: Data Structure Time: 3 Hours Maximum Marks: 60 Note: Question 1.
More informationCS-6402 DESIGN AND ANALYSIS OF ALGORITHMS
CS-6402 DESIGN AND ANALYSIS OF ALGORITHMS 2 marks UNIT-I 1. Define Algorithm. An algorithm is a sequence of unambiguous instructions for solving a problem in a finite amount of time. 2.Write a short note
More informationOverview of Sorting Algorithms
Unit 7 Sorting s Simple Sorting algorithms Quicksort Improving Quicksort Overview of Sorting s Given a collection of items we want to arrange them in an increasing or decreasing order. You probably have
More informationModel Answer. Section A Q.1 - (20 1=10) B.Tech. (Fifth Semester) Examination Analysis and Design of Algorithm (IT3105N) (Information Technology)
B.Tech. (Fifth Semester) Examination 2013 Analysis and Design of Algorithm (IT3105N) (Information Technology) Model Answer. Section A Q.1 - (20 1=10) 1. Merge Sort uses approach to algorithm design. Ans:
More informationlogn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)
CSE 0 Test Your name as it appears on your UTA ID Card Fall 0 Multiple Choice:. Write the letter of your answer on the line ) to the LEFT of each problem.. CIRCLED ANSWERS DO NOT COUNT.. points each. The
More informationCLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION
CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION 1. What is performance measurement? 2. What is an algorithm? 3. How the algorithm is good? 4. What are the
More informationCSCE 321/3201 Analysis and Design of Algorithms. Prof. Amr Goneid. Fall 2016
CSCE 321/3201 Analysis and Design of Algorithms Prof. Amr Goneid Fall 2016 CSCE 321/3201 Analysis and Design of Algorithms Prof. Amr Goneid Course Resources Instructor: Prof. Amr Goneid E-mail: goneid@aucegypt.edu
More information4.1.2 Merge Sort Sorting Lower Bound Counting Sort Sorting in Practice Solving Problems by Sorting...
Contents 1 Introduction... 1 1.1 What is Competitive Programming?... 1 1.1.1 Programming Contests.... 2 1.1.2 Tips for Practicing.... 3 1.2 About This Book... 3 1.3 CSES Problem Set... 5 1.4 Other Resources...
More informationAlgorithms and Data Structures (INF1) Lecture 15/15 Hua Lu
Algorithms and Data Structures (INF1) Lecture 15/15 Hua Lu Department of Computer Science Aalborg University Fall 2007 This Lecture Minimum spanning trees Definitions Kruskal s algorithm Prim s algorithm
More informationChapter 1 Introduction
Preface xv Chapter 1 Introduction 1.1 What's the Book About? 1 1.2 Mathematics Review 2 1.2.1 Exponents 3 1.2.2 Logarithms 3 1.2.3 Series 4 1.2.4 Modular Arithmetic 5 1.2.5 The P Word 6 1.3 A Brief Introduction
More information15CS43: DESIGN AND ANALYSIS OF ALGORITHMS
15CS43: DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK MODULE1 1. What is an algorithm? Write step by step procedure to write an algorithm. 2. What are the properties of an algorithm? Explain with an
More information( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1
CSE 0 Name Test Summer 00 Last Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose you are sorting millions of keys that consist of three decimal
More informationCSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS
CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS Analyzing find in B-trees Since the B-tree is perfectly height-balanced, the worst case time cost for find is O(logN) Best case: If every internal node is completely
More informationAlgorithms and Data Structures CS-CO-412
Algorithms and Data Structures CS-CO-412 David Vernon Professor of Informatics University of Skövde Sweden david@vernon.eu www.vernon.eu Algorithms and Data Structures 1 Copyright D. Vernon 2014 Algorithmic
More informationThe ADT priority queue Orders its items by a priority value The first item removed is the one having the highest priority value
The ADT priority queue Orders its items by a priority value The first item removed is the one having the highest priority value 1 Possible implementations Sorted linear implementations o Appropriate if
More information9. The expected time for insertion sort for n keys is in which set? (All n! input permutations are equally likely.)
CSE 0 Name Test Spring 006 Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose f ( x) is a monotonically increasing function. Which of the
More informationCSci 231 Final Review
CSci 231 Final Review Here is a list of topics for the final. Generally you are responsible for anything discussed in class (except topics that appear italicized), and anything appearing on the homeworks.
More informationCOURSE: DATA STRUCTURES USING C & C++ CODE: 05BMCAR17161 CREDITS: 05
COURSE: DATA STRUCTURES USING C & C++ CODE: 05BMCAR17161 CREDITS: 05 Unit 1 : LINEAR DATA STRUCTURES Introduction - Abstract Data Types (ADT), Arrays and its representation Structures, Stack, Queue, Circular
More informationAlgorithms and Data Structures CS-CO-412
Algorithms and Data Structures CS-CO-412 David Vernon Professor of Informatics University of Skövde Sweden david@vernon.eu www.vernon.eu Algorithms and Data Structures 1 Copyright D. Vernon 2014 Trees
More informationThe Algorithm Design Manual
Steven S. Skiena The Algorithm Design Manual With 72 Figures Includes CD-ROM THE ELECTRONIC LIBRARY OF SCIENCE Contents Preface vii I TECHNIQUES 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 2 2.1 2.2 2.3
More informationContents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix)
Contents Preface... (vii) Acknowledgements... (ix) 1 Introduction 1.1 Algorithm 1 1.2 Life Cycle of Design and Analysis of Algorithm 2 1.3 Pseudo-Code for Expressing Algorithms 5 1.4 Recursive Algorithms
More informationR13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)
SET - 1 II B. Tech I Semester Supplementary Examinations, May/June - 2016 PART A 1. a) Write a procedure for the Tower of Hanoi problem? b) What you mean by enqueue and dequeue operations in a queue? c)
More informationReview for Midterm Exam
Review for Midterm Exam 1 Policies and Overview midterm exam policies overview of problems, algorithms, data structures overview of discrete mathematics 2 Sample Questions on the cost functions of algorithms
More informationLecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29
Lecture 13 Connectedness in graphs Spanning trees in graphs Finding a minimal spanning tree Time costs of graph problems and NP-completeness Finding a minimal spanning tree: Prim s and Kruskal s algorithms
More informationCSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014
CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up Nicki Dell Spring 2014 Final Exam As also indicated on the web page: Next Tuesday, 2:30-4:20 in this room Cumulative but
More information( ). Which of ( ) ( ) " #& ( ) " # g( n) ( ) " # f ( n) Test 1
CSE 0 Name Test Summer 006 Last Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply two n x n matrices is: A. "( n) B. "( nlogn) # C.
More informationOutline. Graphs. Divide and Conquer.
GRAPHS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books. Outline Graphs.
More informationCS301 - Data Structures Glossary By
CS301 - Data Structures Glossary By Abstract Data Type : A set of data values and associated operations that are precisely specified independent of any particular implementation. Also known as ADT Algorithm
More informationIntroduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis
Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis p. 5 Statement Constructs p. 5 Pseudocode Example p.
More informationCS521 \ Notes for the Final Exam
CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )
More informationCS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I
CS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I PART A(2MARKS) 1. What is an algorithm? 2. What is meant by open hashing? 3. Define Ω-notation 4.Define order of an algorithm. 5. Define O-notation
More informationReference Sheet for CO142.2 Discrete Mathematics II
Reference Sheet for CO14. Discrete Mathematics II Spring 017 1 Graphs Defintions 1. Graph: set of N nodes and A arcs such that each a A is associated with an unordered pair of nodes.. Simple graph: no
More informationDesign and Analysis of Algorithms. Comp 271. Mordecai Golin. Department of Computer Science, HKUST
Design and Analysis of Algorithms Revised 05/02/03 Comp 271 Mordecai Golin Department of Computer Science, HKUST Information about the Lecturer Dr. Mordecai Golin Office: 3559 Email: golin@cs.ust.hk http://www.cs.ust.hk/
More informationDesign and Analysis of Algorithms - - Assessment
X Courses» Design and Analysis of Algorithms Week 1 Quiz 1) In the code fragment below, start and end are integer values and prime(x) is a function that returns true if x is a prime number and false otherwise.
More informationDATA STRUCTURES AND ALGORITHMS
DATA STRUCTURES AND ALGORITHMS UNIT 1 - LINEAR DATASTRUCTURES 1. Write down the definition of data structures? A data structure is a mathematical or logical way of organizing data in the memory that consider
More information) $ f ( n) " %( g( n)
CSE 0 Name Test Spring 008 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to compute the sum of the n elements of an integer array is: # A.
More information( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&
CSE 0 Name Test Summer 008 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time for the following code is in which set? for (i=0; i
More informationAP Computer Science 4325
4325 Instructional Unit Algorithm Design Techniques -divide-and-conquer The students will be -Decide whether an algorithm -classroom discussion -backtracking able to classify uses divide-and-conquer, -worksheets
More informationAlgorithms and Data Structures
Algorithm Analysis Page 1 - Algorithm Analysis Dr. Fall 2008 Algorithm Analysis Page 2 Outline Textbook Overview Analysis of Algorithm Pseudo-Code and Primitive Operations Growth Rate and Big-Oh Notation
More informationUCS-406 (Data Structure) Lab Assignment-1 (2 weeks)
UCS-40 (Data Structure) Lab Assignment- (2 weeks) Implement the following programs in C/C++/Python/Java using functions a) Insertion Sort b) Bubble Sort c) Selection Sort d) Linear Search e) Binary Search
More information( D. Θ n. ( ) f n ( ) D. Ο%
CSE 0 Name Test Spring 0 Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to run the code below is in: for i=n; i>=; i--) for j=; j
More informationCS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 25: Review and Open Problems Course Overview Programming Concepts Object-Oriented Programming Interfaces
More informationDATA STRUCTURES AND ALGORITHMS
DATA STRUCTURES AND ALGORITHMS For COMPUTER SCIENCE DATA STRUCTURES &. ALGORITHMS SYLLABUS Programming and Data Structures: Programming in C. Recursion. Arrays, stacks, queues, linked lists, trees, binary
More informationn 2 ( ) ( ) + n is in Θ n logn
CSE Test Spring Name Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply an m n matrix and a n p matrix is in: A. Θ( n) B. Θ( max(
More informationData Structures Question Bank Multiple Choice
Section 1. Fundamentals: Complexity, Algorthm Analysis 1. An algorithm solves A single problem or function Multiple problems or functions Has a single programming language implementation 2. A solution
More informationPh.D. Comprehensive Examination Design and Analysis of Algorithms
Ph.D. Comprehensive Examination Design and Analysis of Algorithms Main Books 1. Cormen, Leiserton, Rivest, Introduction to Algorithms, MIT Press, 2001. Additional Books 1. Kenneth H. Rosen, Discrete mathematics
More information( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο
CSE 0 Name Test Fall 0 Multiple Choice. Write your answer to the LEFT of each problem. points each. The expected time for insertion sort for n keys is in which set? (All n! input permutations are equally
More informationCSE 100 Minimum Spanning Trees Prim s and Kruskal
CSE 100 Minimum Spanning Trees Prim s and Kruskal Your Turn The array of vertices, which include dist, prev, and done fields (initialize dist to INFINITY and done to false ): V0: dist= prev= done= adj:
More informationDATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305
Q.1 If h is any hashing function and is used to hash n keys in to a table of size m, where n
More informationAlgorithms and Data Structures CS-CO-412
Algorithms and Data Structures CS-CO-412 David Vernon Professor of Informatics University of Skövde Sweden david@vernon.eu www.vernon.eu Algorithms and Data Structures 1 Copyright D. Vernon 2014 Trees
More informationCS302 Data Structures using C++
CS302 Data Structures using C++ Study Guide for the Final Exam Fall 2018 Revision 1.1 This document serves to help you prepare towards the final exam for the Fall 2018 semester. 1. What topics are to be
More information& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n
CSE Name Test Summer Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to multiply two n " n matrices is: A. " n C. "% n B. " max( m,n, p). The
More information( ) 1 B. 1. Suppose f x
CSE Name Test Spring Last Digits of Student ID Multiple Choice. Write your answer to the LEFT of each problem. points each is a monotonically increasing function. Which of the following approximates the
More informationCourse Name: B.Tech. 3 th Sem. No of hours allotted to complete the syllabi: 44 Hours No of hours allotted per week: 3 Hours. Planned.
Course Name: B.Tech. 3 th Sem. Subject: Data Structures No of hours allotted to complete the syllabi: 44 Hours No of hours allotted per week: 3 Hours Paper Code: ETCS-209 Topic Details No of Hours Planned
More informationExam Sample Questions CS3212: Algorithms and Data Structures
Exam Sample Questions CS31: Algorithms and Data Structures NOTE: the actual exam will contain around 0-5 questions. 1. Consider a LinkedList that has a get(int i) method to return the i-th element in the
More informationn 2 ( ) ( ) Ο f ( n) ( ) Ω B. n logn Ο
CSE 220 Name Test Fall 20 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 4 points each. The time to compute the sum of the n elements of an integer array is in:
More informationData Structures and Algorithms
Berner Fachhochschule - Technik und Informatik Data Structures and Algorithms Topic 1: Algorithm Analysis Philipp Locher FS 2018 Outline Course and Textbook Overview Analysis of Algorithm Pseudo-Code and
More informationDESIGN AND ANALYSIS OF ALGORITHMS
QUESTION BANK DESIGN AND ANALYSIS OF ALGORITHMS UNIT1: INTRODUCTION OBJECTIVE: Algorithms play the central role in both the science and the practice of computing. There are compelling reasons to study
More informationChapter 9 Graph Algorithms
Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 3 Definitions an undirected graph G = (V, E)
More informationTopic Analysis PART-A
Govt. of Karnataka, Department of Technical Education Diploma in Information Science & Engineering Third Semester Subject: ANALYSIS AND DESIGN OF ALGORITHM Contact Hrs / week: Total hrs: 64 Topic Analysis
More information11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions
Introduction Chapter 9 Graph Algorithms graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 2 Definitions an undirected graph G = (V, E) is
More informationTotal No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C
CSE/IT 216 (CR) Total No. of Questions :09] [Total No. of Pages : 02 Time: Three Hours 1. a. ADT II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC- 2015 First Semester CSE/IT DATA STRUCTURES USING C Answer Question
More informationR13 SET - 1. ''' '' ''' ' blog: anilkumarprathipati.wordpress.com. Code No: RT32054
R13 SET - 1 III B. Tech II Semester Regular Examinations, April - 2016 1 a) Distinguish between Algorithm and Psuedocode. [3M] b) Describe the Algorithm Analysis of Binary Search. [4M] c) State the Job
More informationAlgorithmic Analysis. Go go Big O(h)!
Algorithmic Analysis Go go Big O(h)! 1 Corresponding Book Sections Pearson: Chapter 6, Sections 1-3 Data Structures: 4.1-4.2.5 2 What is an Algorithm? Informally, any well defined computational procedure
More informationMultiple Choice. Write your answer to the LEFT of each problem. 3 points each
CSE 0-00 Test Spring 0 Name Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose f ( x) is a monotonically increasing function. Which of the
More informationL.J. Institute of Engineering & Technology Semester: VIII (2016)
Subject Name: Design & Analysis of Algorithm Subject Code:1810 Faculties: Mitesh Thakkar Sr. UNIT-1 Basics of Algorithms and Mathematics No 1 What is an algorithm? What do you mean by correct algorithm?
More informationCS61BL. Lecture 5: Graphs Sorting
CS61BL Lecture 5: Graphs Sorting Graphs Graphs Edge Vertex Graphs (Undirected) Graphs (Directed) Graphs (Multigraph) Graphs (Acyclic) Graphs (Cyclic) Graphs (Connected) Graphs (Disconnected) Graphs (Unweighted)
More informationCourse goals. exposure to another language. knowledge of specific data structures. impact of DS design & implementation on program performance
Course goals exposure to another language C++ Object-oriented principles knowledge of specific data structures lists, stacks & queues, priority queues, dynamic dictionaries, graphs impact of DS design
More informationCOMP Data Structures
COMP 2140 - Data Structures Shahin Kamali Topic 5 - Sorting University of Manitoba Based on notes by S. Durocher. COMP 2140 - Data Structures 1 / 55 Overview Review: Insertion Sort Merge Sort Quicksort
More informationCS Transform-and-Conquer
CS483-11 Transform-and-Conquer Instructor: Fei Li Room 443 ST II Office hours: Tue. & Thur. 1:30pm - 2:30pm or by appointments lifei@cs.gmu.edu with subject: CS483 http://www.cs.gmu.edu/ lifei/teaching/cs483_fall07/
More informationGreedy Approach: Intro
Greedy Approach: Intro Applies to optimization problems only Problem solving consists of a series of actions/steps Each action must be 1. Feasible 2. Locally optimal 3. Irrevocable Motivation: If always
More informationComputer Science E-22 Practice Final Exam
name Computer Science E-22 This exam consists of three parts. Part I has 10 multiple-choice questions that you must complete. Part II consists of 4 multi-part problems, of which you must complete 3, and
More informationAlgorithms: Design & Practice
Algorithms: Design & Practice Deepak Kumar Bryn Mawr College Spring 2018 Course Essentials Algorithms Design & Practice How to design Learn some good ones How to implement practical considerations How
More informationQuestion Paper Code : 97044
Reg. No. : Question Paper Code : 97044 B.E./B.Tech. DEGREE EXAMINATION NOVEMBER/DECEMBER 2014 Third Semester Computer Science and Engineering CS 6301 PROGRAMMING AND DATA STRUCTURES-II (Regulation 2013)
More informationTopics for CSCI 151 Final Exam Wednesday, May 10
Topics for CSCI 151 Final Exam Wednesday, May 10 Java and Programming Techniques Types Inheritance Generics Abstract classes and interfaces Exceptions Recursion Writing recursive methods Dynamic Programming
More informationYour favorite blog : (popularly known as VIJAY JOTANI S BLOG..now in facebook.join ON FB VIJAY
Course Code : BCS-042 Course Title : Introduction to Algorithm Design Assignment Number : BCA(IV)-042/Assign/14-15 Maximum Marks : 80 Weightage : 25% Last Date of Submission : 15th October, 2014 (For July
More informationA6-R3: DATA STRUCTURE THROUGH C LANGUAGE
A6-R3: DATA STRUCTURE THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF
More informationWhat s New in the Second Edition
What s New in the Second Edition This second edition of Data Structures and Algorithms in Java has been augmented to make it easier for the reader and for instructors using it as a text in computer science
More informationA6-R3: DATA STRUCTURE THROUGH C LANGUAGE
A6-R3: DATA STRUCTURE THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF
More informationD. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D.
CSE 0 Name Test Fall 00 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. The time to convert an array, with priorities stored at subscripts through n,
More informationSelection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix
Spring 2010 Review Topics Big O Notation Heaps Sorting Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix Hashtables Tree Balancing: AVL trees and DSW algorithm Graphs: Basic terminology and
More informationSchool of Computing and Information Sciences. Course Title: Data Structures Date: 3/30/2010 Course Number: COP 3530 Number of Credits: 3
Course Title: Date: 3/30/2010 Course Number: Number of Credits: 3 Subject Area: Programming Subject Area Coordinator: Tim Downey email: downeyt@cis.fiu.edu Catalog Description: Basic concepts of data organization,
More information