Top Banner
Data Structures Subodh Kumar ( [email protected] , Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi
11

Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar ([email protected], Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Sep 27, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Data StructuresSubodh Kumar

([email protected], Bharti 422)Dept of Computer Sc. & Engg.

IIT Delhi

Page 2: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

! Web: www.cse.iitd.ac.in/~subodh/courses/COL106! Textbook: Data Structures and Algorithms in Java

! by Goodrich & Tamassia! Language: Java! Grading on 100

! Minors 14 each, Major 29! Six assignments: 40

! Keys to success! Don’t cheat! Start early, Don’t fall behind, Seek help from TA! Respond to TA email, Use IITD email

! Class participation: 3! TAs: On course website

! You will be assigned one TA for assistance

Logistics

Page 3: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Academic Honesty! You must solve programming assignments entirely on your

own.! You must neither take, nor show, give or otherwise allow

others to take your program code, solutions, or other work.! Falsifying program output or results is cheating also.! Unless specifically instructed, do not to use any line of

code from any source (including but not limited to books, the Web, your friends etc). The *only* legitimate code is that you thought of yourself and typed in by hand to a simple text editor.

! Java environments (jcreator, javabeans..) are prohibited.! Any exceptions to these rules will be mentioned explicitly

in the assignment.

! You must solve programming assignments entirely on your own.

! You must neither take, nor show, give or otherwise allow others to take your program code, solutions, or other work.

! Falsifying program output or results is cheating also.! Unless specifically instructed, do not to use any line of

code from any source (including but not limited to books, the Web, your friends etc). The *only* legitimate code is that you thought of yourself and typed in by hand to a simple text editor.

! Java environments (jcreator, javabeans..) are prohibited.! Any exceptions to these rules will be mentioned explicitly

in the assignment.

Page 4: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Help & Grading! Office hours of your TA and instructor on course website! Email your TA

! Cc: [email protected]! Emails before 6pm should elicit response the same day

! Next day otherwise! Use COL106 in subject in emails to me! Assignments to be submitted on moodle.iitd.ac.in

! Duplication checking scripts! For all matching submissions:

! 0+grade penalty and F on second violation! Grading scripts (follow instructions exactly)! Viva by TA for selected students

! Respond to call for viva within 24 hours! Failure to respond or explain code = 0

4

Page 5: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

LABs & Attendance! LHC 502: 1-5pm

! Preference to assigned group ! PCLAB-2/3 in CSC: Other times

! Group-wise JAVA tutorial the first two weeks! Group 3: Tue! Group 2: Wed! Group 4: Thu! Group 1: Fri

! 100% attendance is required! Email [email protected] for leave

5

Page 6: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Definition

6

data: /ˈdadə,ˈdādə/ noun facts and statistics collected together for reference or analysis

structure: /ˈstrək(t)SHər/ noun the arrangement of and relations between the parts or elements of something complex

Amount of information in a system is a measure of its degree of organisation [Wiener (1948)]

Concept of information applies not to the individual messages but rather to the situation as a whole [Shannon (1959):]

Data Science: processes and systems to extract knowledge or insights from data in various forms [Wikipedia]

[Oxford]

[Oxford]

Page 7: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Data StructuresCollection of data items and operations! INSERT! DELETE! FETCH

! FIRST/LAST! NEXT/PREVIOUS

! NORTH-WEST! BEST/WORST

! ENQUIRE! MORE-STATS

7

• Types of Data items• Ways to identify an item• Relationships between items• Behavior of Data structure

Page 8: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

What you should learn! Data organization

! Efficient operations! Abstract out the behavior

! sweat details later! Re-use in similar situations

! Use on common algorithms! Applications! Build up a bag of tricks

8

Page 9: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

We will use Java! Object oriented! Similar to C++, but cleaner

! Easier and faster to program in some ways

! Popular in industry! In-built garbage collection

! No ‘delete’ or ‘free’ of memory! No Pointer arithmetic! Platform-independence (in principle)

9

Page 10: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Not C++! Pure object oriented: “everything” is an object in Java

! No struct, enum, unions, template, only classes (but see generic)! Single class hierarchy: Everything gets derived from java.lang.Object

! Java source compiles to byte code! JVM interprets and executes byte code

! Automatic garbage collection: no destructors, only constructors

! No macros: #ifdef, #ifndef, #include! import

! No global function/variable! static method/data within a class

! No multiple inheritance! No pointers but “references"

! Cannot perform arithmetic on references10

Page 11: Data Structuressubodh/courses/COL106/Lec1.pdfData Structures Subodh Kumar (subodh@iitd.ac.in, Bharti 422) Dept of Computer Sc. & Engg. IIT Delhi!

Not C++! Abstract class = interface! array is a class with member .length! package, instead of namespaces! Automatic initialization ! No default argument! No operator overloading! No scope resolution operator “::”

! Method defined only within class! Try/catch required if a function may throw an exception! Keywords const and goto are reserved, but not used! Built-in support for threads! Built-in support for documentation comments: /** ... */ (cf

javadoc) 11