# CSCE 3110 Data Structures and Algorithm Analysis.

## Presentation on theme: "CSCE 3110 Data Structures and Algorithm Analysis."— Presentation transcript:

CSCE 3110 Data Structures and Algorithm Analysis

Dr. Yan Huang Email: huangyan@unt.edu@unt.edu Office: NTRP F251 Phone: 565-8353 TA: TBA Instructor Information

Course Webpage and Schedule Course webpage can be found at: http://www.cse.unt.edu/~huangyan/3110 The lecture schedule is: Tuesdays & Thursdays 2:30PM- 3:50PM @ NTRP B142 Office hour: Class day @ 1:15PM-2:15PM and 4:00-5:00pm or by appointment

Objectives Understand dictionary/search data structures (lists, trees, hash tables). Understand graph representations and algorithms. Understand time and space analysis for both iterative and recursive algorithms and be able to prove the correctness a non-trivial algorithm. Be able to translate high-level, abstract data structure descriptions into concrete code. Understand how real-world problems map to abstract graph problems. Be able to communicate clearly and precisely about the correctness and analysis of basic algorithms (both oral and written communication).

Data structures will include lists, vectors, queues, stacks, trees, hash-tables, and graphs. Algorithms include searching, sorting using the above data structures, iterative, and recursive algorithms On assignments, students are asked to implement data structures and algorithms using a high-level programming language. On exams, students are asked to solve problems using analytical methods and programming skills acquired from lectures and assignments to demonstrate knowledge and comprehension of course material.

 Prerequisites CSCE 2050 and MATH 2770  Text Book “ Data Structures & Algorithm Analysis in C++” (3rd Edition). Mark Allen Weiss  Other Reference “C++ How to Program”, 5th edition, H. M. Deitel, P. J. Deitel

Assumed Background Assumed Background: It is assumed that the student has taken CSCE 2050 and MATH 2770, and thus is knowledgeable about the following: From CSCE 2050: Experience with non-trivial software design; object-oriented design and abstract data types; C++ language features including pointers, classes, and templates; linear and binary searching; recursion; basic data structures (linked lists, stacks, and queues); basic sorting algorithms (insertion, selection, and merge sort); simple time analysis of algorithms. From Math 2770: Proof techniques (induction, contradiction); mathematical structures (sets, relations, trees, graphs); important mathematical manipulations (sums, combinatorics).

What else do you need? Unix account from the department machines Turn in homework using project command Subscribe to the class email list (link available from the class webpage) to be updated promptly about class information

Grading Information Assignments 40% Projects 20% Two exams: 35% Class participation: 5% Grading scale (based on 100 points) A 90-100 points B 80-89 points C 70-79 points D 60-69 points F below points

Programming Assignments Each assignment may have a mixture of written and programming components. Each assignment will specify the material to be turned in. All programming will be in C/C++, and must compile on a University Unix/Linux machine. No credit will be given for programs that do not compile.

Project You have the option to work alone or form a group with another student for the term project If you choose to work in a team, both students will receive the same marks for the project The description of the term project will be posted soon (in two weeks) and you are encouraged to work on it as soon as possible You will have to make a 10 minutes presentation at the end of the semester

Important Notes  All assignments are due before class of the due date. A late penalty of 10% will be applied to all late assignments for up to 3 calendar days. Assignments that are not turned in 3 days after the due date will not be accepted.  All holidays and weekends will be counted as calendar days  Missed exams will be granted zero points. Illness and severe circumstances may be accommodated only with solid evidence. Email me before exam and provide solid evidence whenever possible.

Important Notes  Academic misconduct includes the submission of program code or assignment answers that appear so similar to another person’s work as to be semantically indistinguishable. Misconduct cases will be handles swiftly, discreetly,and summarily in accordance with University principles.

Questions?

What this course is about ? Data structures: conceptual and concrete ways to organize data for efficient storage and efficient manipulation Employment of this data structures in the design of efficient algorithms Analysis of the complexity of your algorithms

Why do we need them Requirements for a good software: Clean Design Easy maintenance Reliable (no core dumps) Easy to use Fast algorithms  Efficient data structures  Efficient algorithms

Why do we need them ? Computers take on more and more complex tasks Imagine: index of 8 billion pages ! (Google) Software implementation and maintenance is difficult. Clean conceptual framework allows for more efficient and more correct code

How Fast Are Our Computers? In current computer architectures, we can perform a linear scan of 1 megabyte of data in 1 second 1 gigabyte of data in 2 minutes 1 terabyte of data in 2 days

How long does it take took to scan 8 billion pages (google)? Now you are searching the word “ insomnia”! Google index 8 billion pages. Assume each page has 100 words (which is a humble number) Each word has 10 letters, each letter is one byte It takes around 21 hours to perform a liner scan of 8 billion pages! Word Wide Wait!

Topics Algorithm Analysis Arrays, Stacks and Queues Vectors, lists and sequences Trees Heaps / Priority Queues Binary Search Trees – Search Trees Hashing / Dictionaries Sorting Graphs and graph algorithms

Example What to do? Sol. 1 Sequential matching Sol. 2 Binary searching: - order the words - search only half at a time Ex. Search 25 in 5 8 12 15 15 17 23 25 27 25 ? 15 15 17 23 25 27 25 ? 23 23 25 27 25 ? 25 How many steps?

One Step Further Given n numbers, how many steps do we need to search a number from the n numbers, using Linear search Binary search (when and when not to use binary search)?

Some example data structures Set Stack Tree Data structure = representation and operations associated with a data type

What will you learn? What are some of the common data structures What are some ways to implement them How to analyze the complexity of your algorithms using the data structures How to use them to solve practical problems