Chapter 1: Introduction to Data Structures(8M)

Slides:



Advertisements
Similar presentations
Chapter 10 C Structures, Unions, Bit Manipulations, and Enumerations.
Advertisements

EC-211 DATA STRUCTURES LECTURE 2. EXISTING DATA STRUCTURES IN C/C++ ARRAYS – A 1-D array is a finite, ordered set of homogeneous elements – E.g. int a[100]
Structure.
Structures Spring 2013Programming and Data Structure1.
Enumeration Data Type enum Day {SUN, MON, TUE, WED, THU, FRI, SAT}; Day today; today = WED; if (today == FRI) cout
Structures. An array allows us to store a collection of variables However, the variables must be of the same type to be stored in an array E.g. if we.
1 Types The type of a variable represents a set of values that may be assigned to the variable. For example, an integer variable is one that may take the.
COMP102 – Programming Fundamentals I LA2B (Mon 5-7pm) LA2E (Fri 3-5pm) LA2F (Fri 5-7pm) TA: Jackie Lo.
Data Type. A data type defines a set of values that a variable can store along with a set of operations that can be performed on that variable. Common.
21 August (B.V.Patel institute of BMC & IT) STRUCTURE AND UNIONS.
Prepared By Ms.R.K.Dharme Head Computer Department.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 10 - C Structures, Unions, Bit Manipulations,
Structures in C++ UNIVERSITY OF THE PUNJAB (GUJRANWALA CAMPUS) 1 ADNAN BABAR MT14028 CR.
Array, Structure and Union
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11: Structured Data.
Programming Fundamentals. Today’s Lecture The Conditional Operator Logical Operators Structures Enumerations.
 Structures are like arrays except that they allow many variables of different types grouped together under the same name. For example you can create.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
Ch Chapter 4 Basic Data Types and Variables 4.1 Basic Data Types In C TABLE 4.1 Introduction to Basic Data Types in C Type SizeDescription char 1.
CPT: Types/ Computer Programming Techniques Semester 1, 1998 Objective of these slides: –to look at how new types can be created 6. User-defined.
UNION UNIT -II. Unions A union is another compound datatype like a structure. So what is the properties of structure? Eg: Union exam { int roll_no; Char.
Structures and Union. Review bitwise operations –you need them for performance in terms of space and time –shifts are equivalent to arithmetics enumeration.
1 Lecture06: Complex Types 4/18/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
Introduction to Computers and Programming Class 24 Structures (structs) Professor Avi Rosenfeld.
1 Lecture10: Structures, Unions and Enumerations 11/26/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction to C.
Structure A collection of values (members) struct date{ int day; char month[10]; int year; }; Declare a structure variable struct date today; struct struct_name.
COMP102 Lab 111 COMP 102 Programming Fundamentals I Presented by : Timture Choi.
Chapter 6. Character String Types It is one in which the values consists of sequences of characters. How to Define a variable contain a string? In a programming.
What do I need to Know For My Assignment?. C Pointer Review To declare a pointer, we use the * operator. This is similar to but different from using *
Chapter 11 Structures, Unions and Typedef 11.1 Structures Structures allow us to group related data items of different types under a common name. The individual.
Lecture 10 union, enumeration, bit
5 Day Forecast Mon Tues Wed Thu Fri.
LESSON 06.
Chapter 6 – Data Types CSCE 343.
Chapter 10-1: Structure.
Pointers, Enum, and Structures
Instructor : Ahmed Alalawi Slides from Chung –Ta King
(Structures,Unions, Enumerations )
Visit for more Learning Resources
Instructor: Ioannis A. Vetsikas
typedef typedef int Index; typedef char Letter; Index i; i = 17;
DATA HANDLING.
S. Kiran, PGT (CS) KV, Malleswaram
Structures and Union.
Derived types.
MON TUE WED THU
Windows Programming Lecture 04
2008 Calendar.
Structures and Union.
Objectives In this chapter, you will: - Learn about records (structs) - Examine operations on a struct - Manipulate data using a struct - Learn about the.
Chapter 10 Structures and Unions
Structure.
Sun Mon Tue Wed Thu Fri Sat
C Structures, Unions, Bit Manipulations and Enumerations
C Programming Lecture-13 Structures
Structures In C Programming By Rajanikanth B.
Chapter 6 Part 1.
Sun Mon Tue Wed Thu Fri Sat
C Programming Lecture-14 Unions
Structures and Union.
1/○~1/○ weekly schedule MON TUE WED THU FRI SAT SUN MEMO
Data Structures and ADTs
2016 | 10 OCT SUN MON TUE WED THU FRI SAT
C Language B. DHIVYA 17PCA140 II MCA.
Sun Mon Tue Wed Thu Fri Sat
Structures Chapter 4.
Structures, Unions, and Enumerations
2008 Calendar.
Exercise 6 – Compound Types und Kontrollfluss
Presentation transcript:

Chapter 1: Introduction to Data Structures(8M) Visit for more Learning Resources

User Defined Data types- typedef, enum “type definition” allows user to define variable of existing data type. Example. typedef float marks ; marks m1,m2,m3; (in above example marks is used as float data type)

Enumerated data type: enum day(Mon , Tue ,wed ,Thu ,Fri ,Sat , Sun) enum day today; today=Thu

Derived data types- Array ,Structures It is collection of homogeneous data type elements stored in contiguous memory locations. E.g. int a[5]; Element of array is accessed with a[i] where “a” is the array and “i” is the index . a[0] a[1] a[2] a[3] a[4]

It is collection of non-homogeneous (heterogeneous) elements. Structures: It is collection of non-homogeneous (heterogeneous) elements. Using structure we can easily handle complex data structures Elements of structure can be accessed using dot(.) operator E.g. struct stud { int char name[35]; int roll_no; char addr[50] }s; s.Name //access the name field

Union It is similar to structure data type . Difference between structure and union is that in structure every data member has its own storage where members of union shares same memory locations. Elements of structure can be accessed using dot(.) operator Storage for below union is 4bytes E.g union item { int m; //2byte float z; //4 byte char c; //1 byte }u; u.m //access m field For more detail contact us