Introduction to Data Structures &Algorithms

Similar documents
5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

10CS35: Data Structures Using C

Data Structure [Question Bank]

Data Structures. Level 6 C Module Descriptor

1. Relational database accesses data in a sequential form. (Figures 7.1, 7.2)

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

DATA STRUCTURES USING C

PES Institute of Technology-BSC QUESTION BANK

Sample Questions Csci 1112 A. Bellaachia

Binary Heap Algorithms

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

COMPUTER SCIENCE (5651) Test at a Glance

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Data Structure with C

Algorithms and Data Structures Exercise for the Final Exam (17 June 2014) Stack, Queue, Lists, Trees, Heap

MICHIGAN TEST FOR TEACHER CERTIFICATION (MTTC) TEST OBJECTIVES FIELD 050: COMPUTER SCIENCE

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Algorithms and Data Structures

Class Notes CS Creating and Using a Huffman Code. Ref: Weiss, page 433

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

COMPUTER SCIENCE. Paper 1 (THEORY)

COMPUTER SCIENCE 1999 (Delhi Board)

The Elective Part of the NSS ICT Curriculum D. Software Development

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

AP Computer Science AB Syllabus 1

Heaps & Priority Queues in the C++ STL 2-3 Trees

Binary Search Trees. Data in each node. Larger than the data in its left child Smaller than the data in its right child

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Big Data and Scripting. Part 4: Memory Hierarchies

Abstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Sorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)

Unit Write iterative and recursive C functions to find the greatest common divisor of two integers. [6]

University of Dayton Department of Computer Science Undergraduate Programs Assessment Plan DRAFT September 14, 2011

DNA Data and Program Representation. Alexandre David

Chapter 5. Selection 5-1

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Syllabus for Computer Science. Proposed scheme for B.Sc Programme under Choice Based Credit System

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Course Curriculum. DATA STRUCTURES (Code: )

Lecture 1: Data Storage & Index

Course MS10975A Introduction to Programming. Length: 5 Days

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

50 Computer Science MI-SG-FLD050-02

In-Memory Database: Query Optimisation. S S Kausik ( ) Aamod Kore ( ) Mehul Goyal ( ) Nisheeth Lahoti ( )

Basic Programming and PC Skills: Basic Programming and PC Skills:

Lecture Notes on Binary Search Trees

Binary Search Trees CMPSC 122

Bangalore University B.Sc Computer Science Syllabus ( Semester System)

G. H. RAISONI COLLEGE OF ENGG NAGPUR-16 Session DEPARTMENT CSE Semester IV SUBJECT DSPD

Sources: On the Web: Slides will be available on:

Ordered Lists and Binary Trees

Algorithm & Flowchart & Pseudo code. Staff Incharge: S.Sasirekha

Binary Heaps * * * * * * * / / \ / \ / \ / \ / \ * * * * * * * * * * * / / \ / \ / / \ / \ * * * * * * * * * *

International Journal of Software and Web Sciences (IJSWS)

OKLAHOMA SUBJECT AREA TESTS (OSAT )

A Brief Introduction to MySQL

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

Data Structure and Algorithm I Midterm Examination 120 points Time: 9:10am-12:10pm (180 minutes), Friday, November 12, 2010

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Data Structures and Algorithms Written Examination

Lecture Notes on Linear Search

Introduction to Data Structures

Data Structures and Data Manipulation

Efficient representation of integer sets

CompSci-61B, Data Structures Final Exam

Converting a Number from Decimal to Binary

Full and Complete Binary Trees

LINKED DATA STRUCTURES

Introduction to Data Structures and Algorithms

Data Structures. Chapter 8

Chapter 3: Restricted Structures Page 1

Lecture 12 Doubly Linked Lists (with Recursion)

Performance Improvement In Java Application

Big O and Limits Abstract Data Types Data Structure Grand Tour.

Data Structures Using C++

External Sorting. Why Sort? 2-Way Sort: Requires 3 Buffers. Chapter 13

St S a t ck a ck nd Qu Q eue 1

AP Computer Science Java Mr. Clausen Program 9A, 9B

CHAPTER 4 ESSENTIAL DATA STRUCTRURES

S. Muthusundari. Research Scholar, Dept of CSE, Sathyabama University Chennai, India Dr. R. M.

Stacks. Linear data structures

Binary Trees. Wellesley College CS230 Lecture 17 Thursday, April 5 Handout #28. PS4 due 1:30pm Tuesday, April

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists

Algorithms and Data Structures Written Exam Proposed SOLUTION

Symbol Tables. Introduction

Data Structures Fibonacci Heaps, Amortized Analysis

Binary Trees and Huffman Encoding Binary Search Trees

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION

Exam study sheet for CS2711. List of topics

Lecture Notes on Binary Search Trees

Data Structures and Algorithms

Output: struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr;

Transcription:

Introduction to Data Structures &Algorithms SCSJ2013 Data Structures & Algorithms Nor Bahiah Hj Ahmad &Dayang Norhayati A. Jawawi Faculty of Computing

Objectives: problem solving algorithm concept data structure concept

ProblemSolving Taking the statement of a problem and develop a computer program to solve problems. The entire process requires to pass many phases understanding the problem design solution implement the solution

ProblemSolving A solution to a problem is computer program written in programming language which consist of modules. Type of Modules: function method class several functions or classes other

ProblemSolving A good solution consists of Modules that organize data collection to facilitate operations must store, move, and alter data use algorithms to communicate with one another Advantage of module: Constructing programs Debugging programs Reading programs Modifying programs Eliminating redundant code

ProblemSolving - Modularity Example author firstname secondname getdata() print() write() edit() produce book title year author publisher price getdata() print() checkprice() checkpublisher()

Algorithm Module implements algorithms Algorithm step-by-step recipe for performing a task operate on a collection of data problem solving using logic

Algorithm Well-defined instructions in algorithm includes: 1. when given an initial state (INPUT) 2. proceed through a well-defined series of successive states (PROCESS) 3. eventually terminating in an end-state (OUTPUT)

Algorithm

Algorithm 3 types of algorithm basic control structure Sequential Selection Repeatition Basic algorithm characteristics Finite solution Clear instructions Has input Has output Operate effectively

Algorithm The techniques to design algorithm are such as: Flowchart, pseudo code, State machine and others Factors for measuring good algorithm Running time Total memory usage

Data Structure Data Structure A way of storing and organizing data in a computer so that it can be used efficiently Choosing the right data structure will allow the most efficient algorithm to be used A well-designed data structure : allows a variety of critical operations to be performed enable to use few resources (for both execution time and memory space as possible)

Data Structure Operations to the Data Structure Traversing Searching Insertion Deletion Sorting Merging

Data Types 2 data types Basic data types Structured data types Basic Data Types (C++) store only a single data Integral Boolean bool Enumeration enum Character - char Integer short, int, long Floating point float, double

Storage Structure Structure (struct) Array Queue Data Types Structured Data Types Unsorted Linked List Network State Structure Sorted Linked List Linked Structure Binary Tree Graph Stack

Storage Structure Array Structure Storage Structure typedef struct { int age; char name[25]; enum {male, female} } Person; gender; Person student[30];

Linked Data Structure Linear Data Structure with restriction Queue Linear Data Structure with no restriction Unsorted linked list Non-linear Data Structure Tree Stack Sorted linked list Graph

Linear Data Structure with restriction Queue In Out Back Front

Queue Application

Linear Data Structure with restriction Stack In Out Top

Stack Application

Linear Data Structure with no Linked list restriction 3 12 11

Linear Data Structure with no Sorted linked list restriction Data stored in ascending or descending order with no duplicates Insertion at front, middle or rear of the list Deletion will not affect the ascending / descending order of the list Unsorted linked list A linked list with no ordering

Non-linear Data Structure Children of node 2 Root vertex Tree leaf Sibling

Non-linear Data Structure Directed Undirected graph Graph

Non-linear Data Structure Weighted network

Conclusion Inthis class you have learned about: Problem solving is the entire process of taking the statement of a problem and develop a computer program to solve problems. Algorithm is step-by-step recipe for performing a task operate on a collection of data Data structure is a way of storing and organizing data in a computer, it allows efficient algorithm to be used The knowledge given is to ensure that you are able to provide good solution to problem solving

http://comp.utm.my/ Thank You