1 / 19

Data Structures

Data Structures. Fall 2004. Data Structures. What is data structure? Ans: 探討一群相關資料的 資料表示方法 與 資料運作方法 Objective 使用 最有效率 的方式 , 對一群相關資料進行處理 Programs = Data structures + Algorithms How to analyze and design? 1. 找出並描述對該資料的各種運算 2. 考慮最適當的 Data Structure, 使得各種運算的效率最佳 3. 設計一個完整的 Algorithm.

fruma
Télécharger la présentation

Data Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Structures Fall 2004

  2. Data Structures • What is data structure? • Ans: 探討一群相關資料的資料表示方法與資料運作方法 • Objective • 使用最有效率的方式,對一群相關資料進行處理 • Programs = Data structures + Algorithms • How to analyze and design? 1. 找出並描述對該資料的各種運算 2. 考慮最適當的Data Structure,使得各種運算的效率最佳 3. 設計一個完整的Algorithm

  3. Advantages of Studying DS • Solving problems by existing methods • Understanding good algorithms • Learning analysis and design • Building complex software systems • Documentation • Better programming skills • Knowing hardware & software

  4. Foundation for Other Fields • Six fields in our department • Wireless communication • Computer network • Digital signal processing • VLSI • Computer/mechatronics engineering • Power and power processing

  5. Foundation for Other Fields • Theories • shortest path problem • queuing theory • spanning tree • simulation • Programming techniques • linked list • stack, queue, heap, hash • protocol, driver, firmware design

  6. Example • MapleBBS • Source code structure • Network card driver • RTL8139

  7. Question to Ask How do you start?

  8. Start with Understanding Analysis Design

  9. Example • Problem: • Read in 3 integers • Find the largest and the smallest • Solution: • Using flowchart • Using pseudocode

  10. Structured Programming • One IN one OUT flow • Three basic constructs Sequence Selection Iteration

  11. Pseudocode • English-like (Chinese-like) representation of the code required for an algorithm • Algorithm– Logical steps necessary to solve a problem in a computer • Part English and part structured code • English part– easy to read • Code part– extended version of the basic algorithmic constructs

  12. Writing a Program • Problem statements • Requirements analysis • Design • Abstract design • Architectural design • Detail design • Implementation – coding in C • Test

  13. C Programming in Unix • Tools • Editor– vi, joe, pico, etc. • Compiler– gcc – ANSI C • Debugger– gdb • Unix environments • Workstation at the Computer Center • telnet odin.ccunix.ccu.edu.tw • Linux, Free BSD • Linux on Windows or gcc on Windows –not recommended

  14. vi • Text editor • Command driven • Two modes • Command mode • Text-entry mode • Input – everything on the keyboard

  15. vi (cont.) • <ESC> – to escape from the text-entry mode • Single command, repeated command • To go into the text-entry mode • a, A – append • i, I – insert • o, O – add below/above • s, S – substitute • R – replace • cw – change word

  16. vi (cont.) • Editing commands • dd – delete a line • D – delete to the end of a line • yy – copy a line • p – paste what ever is in the buffer • 5dd – to delete 5 lines; 3yy – to copy 3 lines • File commands • :q, :q! – quit • :w, :w! – quit • ZZ – save and quit – :wq

  17. Computer Center • Account name & password • Telnet to workstations • Personal computers

  18. Linux • www.linux.org • www.linuxdoc.org • Distributions • Slackware, Redhat, Mandrake, etc. • Small trial systems • Zipslack • muLinux • Linux-like environment for Windows • Cygwin http://www.cygwin.com/ • http://www.cyut.edu.tw/~ckhung/b/sa/cygwin.shtml

  19. What to do? • Get your account ready from the computer center. • Telnet/ftp to Odin. • Install Linux on your PC. • Review “Introduction to C” • Write and compile a C program under an Unix environment

More Related