SFTW241 PROGRAMMING LANGUAGES ARCHITECTURE I Leader : Peter Wong Secretary : Su Project Tracker : Jesse Web Admin : Nelson Liaison : Jacky.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Pointers.
Chapter 6 Queues and Deques.
C Language.
SFTW241 Group A4 Presentation of Grouping Process.
Introduction to Memory Management. 2 General Structure of Run-Time Memory.
1 Various Methods of Populating Arrays Randomly generated integers.
Overview of Data Structures and Algorithms
Review for Final Exam Dilshad M. NYU. In this review Arrays Pointers Structures Java - some basic information.
CPSC 335 Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Chapter 3 Loaders and Linkers
Understanding the Need for Sorting Records
Quick Sort, Shell Sort, Counting Sort, Radix Sort AND Bucket Sort
Stack and Queue Dr. Bernard Chen Ph.D. University of Central Arkansas.
Memory Management Design & Implementation Segmentation Chapter 4.
Chapter 10.
FALL 2004CENG 351 Data Management and File Structures1 External Sorting Reference: Chapter 8.
Chapter 2: Algorithm Discovery and Design
Recursion.
Algorithm Efficiency and Sorting
Run-time Environment and Program Organization
C++ for Engineers and Scientists Third Edition
Data Structures Using C++ 2E Chapter 9 Searching and Hashing Algorithms.
Programming Logic and Design Fourth Edition, Comprehensive
COMP1170 Midterm Preparation (March 17 th 2009) Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education.
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
CMSC 104, Version 8/061L22Arrays1.ppt Arrays, Part 1 of 2 Topics Definition of a Data Structure Definition of an Array Array Declaration, Initialization,
Data Structures Introduction Phil Tayco Slide version 1.0 Jan 26, 2015.
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
Chapter 7: Arrays. In this chapter, you will learn about: One-dimensional arrays Array initialization Declaring and processing two-dimensional arrays.
Lecture No.01 Data Structures Dr. Sohail Aslam
Chapter 5: Control Structures II (Repetition)
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program.
Today  Table/List operations  Parallel Arrays  Efficiency and Big ‘O’  Searching.
Chapter 12 Recursion, Complexity, and Searching and Sorting
Recursion Textbook chapter Recursive Function Call a recursive call is a function call in which the called function is the same as the one making.
Examples of Recursion Data Structures in Java with JUnit ©Rick Mercer.
Stacks. A stack is a data structure that holds a sequence of elements and stores and retrieves items in a last-in first- out manner (LIFO). This means.
Chapter 5: Control Structures II (Repetition). Objectives In this chapter, you will: – Learn about repetition (looping) control structures – Learn how.
Can’t provide fast insertion/removal and fast lookup at the same time Vectors, Linked Lists, Stack, Queues, Deques 4 Data Structures - CSCI 102 Copyright.
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
Chapter 13 – C++ String Class. String objects u Do not need to specify size of string object –C++ keeps track of size of text –C++ expands memory region.
C Functions Three major differences between C and Java functions: –Functions are stand-alone entities, not part of objects they can be defined in a file.
WEEK 1 Hashing CE222 Dr. Senem Kumova Metin
Programming Logic and Design Fourth Edition, Comprehensive Chapter 8 Arrays.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department.
Data Structures & Algorithms
Review 1 Selection Sort Selection Sort Algorithm Time Complexity Best case Average case Worst case Examples.
Programming games using Visual Basic Files; files vs. databases Reprise on state of program Lab/HW: work on projects, final project.
SFTW241 Programming Languages Architecture I University of Macau Faculty of Science and Technology Computer and Information Science Year2 Class A Group.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
Chapter 15 A External Methods. © 2004 Pearson Addison-Wesley. All rights reserved 15 A-2 A Look At External Storage External storage –Exists beyond the.
Chapter 12 Heaps & HeapSort © John Urrutia 2014, All Rights Reserved1.
SFTW241 Programming Languages Architecture 2002~2003 Semester II Duration: 2003/2/11~ 2003/4/11 University of Macau Faculty of Science and Technology.
Copyright © 2000, Department of Systems and Computer Engineering, Carleton University 1 Introduction An array is a collection of identical boxes.
Course Code #IDCGRF001-A 5.1: Searching and sorting concepts Programming Techniques.
Abstract Data Types and Stacks CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
University of Macau Faculty of Science and Technology Programming Languages Architecture SFTW 241 spring 2004 Class B Group 3.
Computer Science 1620 Sorting. cases exist where we would like our data to be in ascending (descending order) binary searching printing purposes selection.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
Function Recursion to understand recursion you must understand recursion.
Unit 1 - Introducing Abstract Data Type (ADT) Part 3 – Slides 24 to end.
Advanced Data Structures Lecture 1
CHP - 9 File Structures.
Data Structure and Algorithms
External Methods Chapter 15 (continued)
Linked Lists.
Files Management – The interfacing
Presentation transcript:

SFTW241 PROGRAMMING LANGUAGES ARCHITECTURE I Leader : Peter Wong Secretary : Su Project Tracker : Jesse Web Admin : Nelson Liaison : Jacky

 Group B3 original Grouping Process Algorithm.  Problems of output result in Group B3’s Algorithm.  Modified idea of Grouping Process.  C program implementation.  Sample output result.  Analysis of our modified version.  Advice and Feedback from Group B3.

Leader Array : contains 4 strings corresponding to 4 teams. Member Array : which contain 16 strings. (MA) Programming Algorithm: 1.Randomly load the information of the four leaders into the leader array. 2.Load the rest information of the classmates into the MA. 3.Four leader’s information were loaded into the rest positions of the MA. 4.Use MA both for information storage and checking. 5.The pointer: member Counter is the boundary between un-used information and used information 6.If a new member is added, then she or he become the new “leader” whose information will be loaded into the LA instead of the older one. 7. If all of the choices of a “leader” have already been in used array, then the corresponding team should stop their grouping.

Walter WFZH LJQ YYY Walter WFZH LJQ YYY WFZH LJQ YYY LJQ POINTER GROUP A MEMBER LIST OUTPUT : YYY Next Search : LJQ

WFZH LJQ YYY LJQ Walter WFZH LJQ YYY Walter WFZH LJQ YYY WFZH LJQ YYY LJQ REPLACE GROUP A MEMBER LIST POINTER

YYY WFZH LJQ YYY LJQ Walter WFZH LJQ YYY WFZH LJQ YYY LJQ Walter LJQ WFZH GROUP A MEMBER LIST POINTER OUTPUT : LJQ Next Search : YYY ( NOT FOUND ) LJQ ( HAS USED ) WFZH

LJQ YYY LJQ Walter WFZH LJQ YYY WFZH LJQ YYY LJQ Walter LJQ YYY WFZH REPLACE GROUP A MEMBER LIST POINTER YYY Walter LJQ WFZH

YYY Walter WFZH LJQ YYY WFZH LJQ YYY LJQ Walter LJQ WFZH Walter LJQ YYY WFZH GROUP A MEMBER LIST POINTER OUTPUT : WFZH Next Search : YYY ( NOT FOUND ) LJQ ( HAS USED ) Walter ……. Continue Searching

They have a fatal error in producing the output result if there is a looping in member choosing. ( Since the preceding member records have been deleted ) The generated result is always remained the same. The size of the member array is required to define. The number of groups rendered cannot be modified. They haven’t consider the situation of the orphan’s case. They have used extra space for the storage of group members. A lot of swapping will be performed during the execution of the program. This will become a big problem if the number of student records increase.

 Student should give their own favorite members.  First Choice  Third Choice  Second Choice

 Figure : Students’ record link list Peter Jesse Nelson Su Jacky Thomas Jesse Peter Tony Peter Su Eva John Su Jesse John Tom Jacky Peter N students This is the linked list created by the initialization part. Student NameFirst ChoiceSecond ChoiceThird Choice

 Figure : Groups link list M Groups Peter Jesse Nelson Su Tom Tim Jacky Barry Eva John Tony Kent This is the final grouped list that is created by the main program. ( Already considered the orphan’s situation ) Member 1Member 2Member n

Continue…  Initialization of the Program. /* Global Variable */ List Student[student_size] ; List Group[group_number] ; int student_selected[student_size] ; int remain = student_size ;

Continue…  Essential Functions of the Program. /*Search the student according to the algorithm*/ char* search_student( char *name) ; /* Input the information from text file */ void Input_Student_File( ) ; /*random select student if choices link is break*/ char* random_student( ) ;

 Main Procedures of the Program. Continue… int main( ) { Input_Student_File( ) ; /* Randomly select m student for m groups as the headers and insert to the group link list. */ for ( i = 0 ; i < group_number ; i++ ) random_select( ) ;

/* main loop for selecting student */ for (i = 0 ; remain > 0; i++) {if ( student is found in record ) search_student( student_name) ; else if (student link list is break ) random_select( ) ; else if ( remain < m) then */ random_select_group */ random_select( ) ; } }  Main Procedures of the Program.

There are 21 student records and 4 groups need to be created.

There are 21 student records and 6 groups need to be created.

Fixed the fatal error and random problems for their algorithm. Provide the solution to solve the orphan’s case. Use the linked list for the member and the grouped list, this is due to the ease of extension and modification of member lists. We eliminate the swapping part. We use the index array to store the location of unselected student record list, it decrease the failures in searching.

 Better to implement the student ID number in student records.  Searching by student ID is faster and more efficient than searching by student Name. searching by student Name.  Extra space is still needed for the resulting group linked list.  Flexibility in Number of Members and number of groups.  Very clear in understanding the programming algorithm.  Good in considering the orphan cases and cycle cases that they haven’t considered and solved. that they haven’t considered and solved.