Data Structure and Algorithms (DDA 1224) Week 1 Introduction to data structures.

Slides:



Advertisements
Similar presentations
Copyright © 2002 Pearson Education, Inc. Slide 1.
Advertisements

Linked Lists CSE 2451 Matt Boggus. Dynamic memory reminder Allocate memory during run-time malloc() and calloc() – return a void pointer to memory or.
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
Introduction to Linked Lists In your previous programming course, you saw how data is organized and processed sequentially using an array. You probably.
Data Structures: A Pseudocode Approach with C
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are crated using the class definition. Programming techniques.
COSC 120 Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Program Design and Development
1 Lecture 25:Pointers Introduction to Computer Science Spring 2006.
1 ES 314 Advanced Programming Lec 3 Sept 8 Goals: complete discussion of pointers discuss 1-d array examples Selection sorting Insertion sorting 2-d arrays.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 3 Programming and Software.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Introduction to C Programming CE Lecture 19 Linear Linked Lists.
Pointers Applications
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
C FAQ’S Collected from the students who attended technical round in TCS recruitment.
ARRAYS In this Lecture, we will try to develop understanding of some of the relatively complex concepts. The following are explained in this lecture with.
Chapter Introduction to Computers and Programming 1.
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 10. Pointers & Dynamic Data Structures.
CIS Computer Programming Logic
CSC141 Introduction to Computer Programming
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Data Structures Lecture 1 : Model Course Syllabi 0 Dr. Essam Halim Houssein Lecturer, Faculty of Computers and Informatics, Benha University.
Comp 245 Data Structures Linked Lists. An Array Based List Usually is statically allocated; may not use memory efficiently Direct access to data; faster.
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
Review Introduction to Searching External and Internal Searching Types of Searching Linear or sequential search Binary Search Algorithms for Linear Search.
CS212: DATA STRUCTURES Lecture 1: Introduction. What is this course is about ?  Data structures : conceptual and concrete ways to organize data for efficient.
Prepared By Ms.R.K.Dharme Head Computer Department.
Bilgisayar Mühendisliği Bölümü CENG 102 – Computer Programming Melek OKTAY Syllabus Administrative Information.
Objective At the conclusion of this chapter you will be able to:
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
(1 - 1) Introduction to C Data Structures & Abstract Data Types Instructor - Andrew S. O’Fallon CptS 122 (August 26, 2015) Washington State University.
Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Stacks.
CEN 111 Introduction to Algorithms and Programming INTERNATIONAL BURCH UNIVERSITY DEPARTMENT of INFORMATION TECHNOLOGIES Dr. Günay Karlı
APS105 Lists. Structures Arrays allow a collection of elements –All of the same type How to collect elements of different types? –Structures; in C: struct.
Pointers in C++. Topics Covered  Introduction to Pointers  Pointers and arrays  Character Pointers, Arrays and Strings  Examples.
1 Overview of Programming Principles of Computers.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
POINTERS IN C. Introduction  A pointer is a variable that holds a memory address  This address is the location of another object (typically another.
Pointer Lecture 2 Course Name: High Level Programming Language Year : 2010.
Pointers 1. Introduction Declaring pointer variables Pointer operators Pointer arithmetic 2 Topics to be Covered.
Pointers in C by Dr P.Padmanabham Professor (CSE)&Director Bharat Institute of Engineering &Technology Hyderabad Mobile
1 CSC103: Introduction to Computer and Programming Lecture No 17.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Chapter 1: Introduction to Computers and Programming.
Windows Programming Lecture 03. Pointers and Arrays.
(1-3) Basics of a Linked List I Instructor - Andrew S. O’Fallon CptS 122 (June 9, 2016) Washington State University.
Lecture 1 Data Structures Aamir Zia. Introduction Course outline Rules and regulations Course contents Good Programming Practices Data Types and Data.
CS140 – Computer Programming 1 Course Overview First Semester – Fall /1438 – 2016/2017 CS140 - Computer Programming 11.
DDC 2423 DATA STRUCTURE Main text:
UNIT – I Linked Lists.
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
Introduction to Linked Lists
Introduction to Programming
Week # 1: Overview & Review
A programming language
Revision of C++.
COMPUTER 2430 Object Oriented Programming and Data Structures I
Data Structures and Algorithms Introduction to Pointers
C Programming Pointers
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Data Structure and Algorithms (DDA 1224) Week 1 Introduction to data structures

Rules and Regulations during Lecture  Be PUNCTUAL >10 minutes lateness will be considered LATE. >15 minutes lateness will be considered ABSENT.  Keep all your belongings aside and PAY ATTENTION.  Be QUIET. RISE YOUR HAND if you like to interrupt. Use ENGLISH ONLY.  Bring your own laptop/ stationery to jot down notes ONLY AFTER EACH MINI LECTURE.

Course Learning Outcomes  Implement basic data structures.  Apply the use of basic data structures in applications.  Apply the use of searching, sorting and recursive techniques in applications.

Pre-requisites Knowledge C++ Programming language Object-oriented programming (DOP1254)

Orwell Dev-C Size: 51MB Source: Dev-C++Dev-C++ Require Tools

Content SectionTopicsDuration 1Module introduction30 2Mini lecture 1: Data structure30 3Break10 4Mini lecture 2: Algorithms30 5References10

Initial lecture …

Data Structure Data that is being stored during run time. It is an organization of a collection of items. It allows operations like indexing, sorting and searching.

Data structure ArrayStack Linked- list QueueTree Hash table

Pointers A pointer is a variable, which consisted of an address and a value. It is used to refer to an address for another variable. Example: *, Dereferencing operator. Retrieve value for a pointer that it is pointing to. &, Ampersand, referencing operator. Retrieve the address for a pointer that it is pointing to.

Pointers int *pointer; //To declare a pointer. pointer = null; //Initialization of a pointer. int variableA = 5; pointer = variableA; //Pointing pointer to variableA. cout<<*pointer<<endl; //Output: 5 cout<<pointer<<endl; //Output: Address of variableA.

Pointers To declare a pointer int *ptr; ptr = NULL; Point to an array ptr = array; ptr NULL

Pointers int *ptr; ptr = NULL; int arrayA[5]; ptr = arrayA; cout<<*ptr<<endl; //Output: 2 cout<<*(ptr+1)<<endl; //Output: 4 cout<<*(ptr+4)<<endl; //Output: ptr NULL

2D Array Pointer: Part 1 To declare a pointer for the pointers int **ptr; Pointer to the backbone ptr = new int*[5]; ptr

2D Array Pointer: Part 2 Point each of the pointers to a new array. ptr[0] = new int[5]; ptr[1] = new int[5]; ptr[2] = new int[5]; ptr[3] = new int[5]; ptr[4] = new int[5]; cout<<ptr[2][2]<<endl; //Output: 2 cout<<ptr[3][4]<<endl; //Output: 4 cout<<ptr[5][4]<<endl; //Run time error. Because memory is not allocated in the RAM. ptr

2D Array Pointer: Part 3 Point each of the pointers to a new array. ptr[0] = new int[5]; ptr[1] = new int[4]; ptr[2] = new int[3]; ptr[3] = new int[1]; ptr[4] = new int[2]; ptr

Continue lecture …

Algorithms An algorithm is a step by step of instructions to solve a problem. It is a combination of arithmetic operations and logic. Typically the pseudocode are used to express its definitions. Flowcharts are used as well to visualize the flow.

Pseudo codes ALGORITHM GCD(X, Y) 1. WHILE (X ≠ Y) a. IF (X > Y) THEN i. X <- X – Y b. ELSE i. Y <- Y - X 2. RETURN (X) END OF FUNCTION GCD Flowchart FALSE TRUE

References Malik D.S. (2010). Data structure using C++. 2 nd Ed., Thomson Course Technology. Deitel P. (2010). C++: How to program. 7th Ed., Prentice Hall. Main M. (2010). Data structure & other objects using C++. 4 th Ed., Prentice Hall.