1 Data Structures Introduction Homepage : Mail :

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.c files.
Utilizing the GDB debugger to analyze programs Background and application.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
1 Reading Assignments Linux, g++ & dropboxes Simple C/C++ Program (again) Edit, Compile, Test, Submit CSE Lecture 2 – More Preliminaries.
1 Introduction to UNIX 2 Ke Liu
Environment & tools Assistant Anssi Jääskeläinen Visiting hours: Tuesdays Room: 6606
CS 211 Recitation 1 TA: Ishani Chakraborty. Admin stuff Office hours: 5:00-6:00 pm, Tuesdays at Core.
CSCE156: Introduction to Computer Science II Instructor Stephen Scott Website
Unix Programming Tools Operating Systems. man- on-line unix manual vi - a command line text editor make- runs make files gcc- compiler gdb- debugger Operating.
CS Lecture 11 Outline Compiling C programs using gcc Archiving modules Using Makefiles Debugging using gdb Assignment 3 discussion Lecture 111CS.
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
Database Updates Made Easy In WebFocus Using SQL And HTML Painter Sept 2011 Lender Processing Services 1.
Lecture 8  make. Overview: Development process  Creation of source files (.c,.h,.cpp)  Compilation (e.g. *.c  *.o) and linking  Running and testing.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 15: Linked data structures.
리눅스 : Lecture 5 UNIX 유틸리티 : text editor, compilation (make), …
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Creating your first C++ program
Carnegie Mellon Linux Boot Camp Jenna MacCarley, Peter Pearson, Shashank Goyal 9/19/2015.
TAMU CSCE 313 (the basics). Basic Unix/Linux programming Accessing CS systems  PuTTY (putty.exe) – a Telnet and SSH client  Common hosts: unix.cs.tamu.edu.
Lecture 2 Linux Basic Commands,Shell and Make September 8, 2015 Kyu Ho Park.
MPI and High Performance Computing: Systems and Programming Barry Britt, Systems Administrator Department of Computer Science Iowa State University.
Active-HDL Interfaces Debugging C Code Course 10.
Oracle Data Integrator Procedures, Advanced Workflows.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Week 2-3 Control flow (review) Conditional statements If, else, else if, switch-case, break Loop constructs for, while, do-while, break, continue, label--go;
Makefiles. Multiple Source Files (1) u Obviously, large programs are not going to be contained within single files. u C provides several techniques to.
Programming Practice 3 - Dynamic Data Structure
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Chapter 12 C Programming Tools Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, Original Notes.
Data Display Debugger (DDD)
CSE 451: Operating Systems Section 3: Project 0 recap, Project 1.
Basic of UNIX For fresh members of SPARCS
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Suite TUG 2008, Orlando zTPFGI for Applications Jeff Longwell.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
COP 3530 Spring2012 Data Structures & Algorithms Discussion Session Week 2.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
cs33201 Chapter 12 C Programming Tools Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003.
COP 3530 Spring 12 Discussion Session 1. Agenda 1.Introduction 2.Remote programming 3.Separate code 4.Compile -- g++,makefile 5.Debug -- gdb 6.Questions?
C code organization CSE 2451 Rong Shi. Topics C code organization Linking Header files Makefiles.
CS431-cotter1 Linux Programming, Processes, and Threads Man pages (fork, clone, execve, pthread_create) The Linux Programming Interface – Kerrisk, No Starch,
C P ROGRAMMING T OOLS. C OMPILING AND R UNNING S INGLE M ODULE P ROGRAM.
Lesson 6-Using Utilities to Accomplish Complex Tasks.
UNIX Development: g++ and make CS 2204 Class meeting 8 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
Sung-Dong Kim Dept. of Computer Engineering, Hansung University Chapter 3 Programming Tools.
Hank Childs, University of Oregon April 7 th, 2016 CIS 330: _ _ _ _ ______ _ _____ / / / /___ (_) __ ____ _____ ____/ / / ____/ _/_/ ____/__ __ / / / /
L071 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program Reading Sections
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Hank Childs, University of Oregon April 13 th, 2016 CIS 330: _ _ _ _ ______ _ _____ / / / /___ (_) __ ____ _____ ____/ / / ____/ _/_/ ____/__ __ / / /
Lecture 2. Algorithms and Algorithm Convention 1.
CSCI 4061 Recitation 2 1.
Computer System Laboratory
IT 130 The Internet and The Web
Introduction to C Topics Compilation Using the gcc Compiler
Fall 2009 B+ Tree Recitation
Unix Programming Environment
CSE451 Fall 2008 Section 1 Roxana Geambasu
Appendix F C Programming Environment on UNIX Systems
Debugging.
SPL – PS1 Introduction to C++.
Presentation transcript:

1 Data Structures Introduction Homepage : Mail :

2 Schedule 1. Introduction to Unix 2. Array / 과제 #1 3. Queue & Stack 4. Project #1 제출 / 설명 5. 식목일 6. Linked list / 과제 #2 7. Tree 8. 중간고사 9. Project#2 제출 / 설명 10. Encoding 11. Graph / 과제 #3 12. Sorting 13. Project #3 제출 / 설명 14. Hashing 15. 기말고사

3 Grading Policy (1) Total=3  Project(35)+3x 숙제 (15)+ 출석 (10) Project (35) = Project (100)  0.35 숙제 (15) = 과제 (100)  0.15 Assignment (100) = Program (90) + Report (10) Program (90) = Compile (10) Comment (10) Execution (Correctness) (70)

4 Grading Policy (2) Copy 적발 시 Program = 0 No Late Submission No Submission F

5 Data Structures #1 Introduction to Unix

6 기본 Tool 사용법 man: find and display reference manual pages Usage: >man [query] ftp: User interface to file transfer protocol Usage: >ftp [ip_address | Hostname] telnet: communicate with another host Usage : >telnet [ip_address | Hostname] vi editor: Screen-oriented display editor based on ex Usage: >vi [options][filename] More Info.: man page

7 Compile & Debug (GNU) g++: C and C++ compilers are integrated Usage : g++ [-options | filenames]…  -c [source_filename] : compile & generate an object file (.o)  -o [execute_filename] [object_files] [libraries] : generate execution file  -g : use debug More info. >man g++

8 Compile & Debug (GNU).c.c.h.h

9 gdb: Debugger for gcc and g++ > gdb [executable file] > (gdb) b or break [line_number] > (gdb) r or run > (gdb) n or next > (gdb) s or step > (gdb) display For more info. > (gdb) help > man gdb

10 #include struct samp{ int a, b; }; main() { struct samp ob[5]={{1,2},{3,4},{5.6},{7.8},{9,10}}; int i; samp *p; p=ob; /* get stating address of array */ for( i=0; i<4; i++){ printf(“%d ”, p->a); printf(“%d \n”, p->b); p++; } printf(“\n”); return 0; } Example Compile & Debug (GNU)

11 Example Compile & Debug (GNU )

12 Example Compile & Debug (GNU)

13 Make (1) make 의 필요성 여러 개의 파일로 나누어 개발할 경우  링크 에러의 원인이 되기도 함  에러의 원인을 제대로 찾기가 힘이 든다 수정한 file 만 새롭게 update 할 필요가 있을 때 make 를 사용 make 명령으로 여러 file 을 compile

14 Make (2) Make file 은 반드시 makefile 이라는 file name 사용 다른 file name 을 사용 할 경우 -f option 사용 makefile 의 구성 target dependency command ex) test.o (target):test.h test.c (dependency) g++ -c test.c (command) command 부분은 반드시 제일 앞에 TAB character 사용

15 Make (3) Example test test.otest1.o test.c test.h test1.c test1.h

16 Make (4) Example must tab

17 Make (5) Example

18 Assignment 제출 요령 (1) >telnet or telnet ce1.ce.hongik.ac.kr 로 접속 Using Submit, can ’ t overwrite tar: create tape archives and add or extract files make assign.tar at parent directory of assign >tar cvf assign.tar assign unpack.tar file >tar xvf assign.tar File_name: Student-ID_Version.tar A011001_hw1.tar (Must be include *.h, *.c, makefile) Make sure your program on ce execution before submission

19 Assignment 제출 요령 (2) Usage : submit #> submit (Prof. Or T/A 계정 ) ( 제출 디렉토리 ) ( 제출할 화일이름 ) - 계정 : jhbang - 제출 디렉토리 구성 : 반이름 / 과제 + 과제번호 예 ) f 반, 숙제 #1 또는 project#1 : f/hw1 or f/pro1

20 Comment - example (1) File Head Comment /*********************************************************************/ /* File Name : Main.c */ /* Date: 2001/3/09 */ /* Compiler: g */ /* Os: Solaris 7.2*/ /* Author: Bang ji ho */ /* Student ID: A011053*/ /* */ /* ver: 1.0.0*/ /* Description : … */ /* Etc..: Data Structure Homework #1 ( sparse matrix ) */ /*********************************************************************/

21 Comment - example (2) Function Head Comment /*********************************************************************/ /* TMatrix :: _InsertNode*/ /* ================================================================= */ /* Input: Node* -> Insert Node,*/ /* Node* -> Column node before insert node*/ /* Node* -> Row node before insert node*/ /*(Input parameter Description)*/ /* Output: int - 1 success*/ /* 0 - fail*/ /*(Out parameter Description)*/ /* Purpose: Insert node*/ /*********************************************************************/

22 Comment - example (3) In-Line Comment /********************** Row insert **************************/ if( pRowPos->pNextRow != pRowPos ) { pTemp->pNextRow = pRowPos->pNextRow;// pTemp set next row if( !( pRowPos->pNextRow->bHead ) ){ pRowPos->pNextRow->NodeItem.pPrevRow = pTemp; } // end of if else { pTemp->pNextRow = pRowPos;// pTemp set next row } // end of else pTemp->NodeItem.pPrevRow = pRowPos;// pTemp set previous row pRowPos->pNextRow = pTemp; /********************** End of row insert ********************/

23 Report 제출 요령 Program Overview Algorithm pseudo code flow char etc. Analysis

24 Report 제출요령 - example (1) Algorithm - pseudo code FixHeap(Node *root, Key k) { Node vacant, largerChild; vacant = root; while( vacant is not leaf ) { largerChild = the child of vacant with the larger key; if( k < largerChild’s Key ) { copy lagerChild’s key to vacant; vacant = largerChild; } else exit loop; }

25 Report 제출요령 - example (2) Algorithm - Flow Chart (Each function) Start Make head node Find inserted position Insert End Find head node