Free Essay

Data Structures and Implementation

In: Computers and Technology

Submitted By xgonnahaveitx
Words 730
Pages 3
James Mueller
Data Structures and Implementation
Unit 5 Individual Project
ITCO321 – 1103A - 02
August 21, 2011

Does the word matching exist in the phrase. In the phrase “There exists just a single example”, the word exam is indeed in this phrase. Exam is matched to the word Example as seen here. In order to for the word to be matched, using just plain vision was possible, however, in a computer sense; one must use a pattern matching string so that the program would be able to find the match. When using coding to determine if there is a match in the pattern, you would use the RegularExpression namespace. This will allow for easy parsing and matching of strings to a specific patter (miscrosoft.com, 2011). Regex myRegEx = new Regex("exam"); string s1 = "There exists just a single example.";

if (myRegEx.IsMatch(s1)) Console.WriteLine("Match found!");

Explain how you could 'teach' a computer to match the word 'exam' in the given phrase above. In order to do this in C#, you could write 4 separate search commands, or you can be more efficient and you can do it in a single phrase. By using pattern = ‘e ?x ?a ?m?’; . now you can locate one or more of the strings with just a single command: Text = [‘There exists just a single example’]; Regexp (text, pattern, ‘match’) Ans = ‘exam’. This is just one of many ways that you could teach a computer to find the word exam in the phrase. You are also able to use different MATLAB returns (MathWorks.com, 2011). Boyer-Moore pattern matching algorithm The algorithm works by creating a “skip table” to each possible character. By using this skip table, the number of actual comparisons needed to locate a string can decrease, and in some cases dramatically (Wood, J.). Comparison is done from right to left, starting with the last character in the patter. So with our search pattern being ‘exam’, we would algorithm would be done as such: There exists just a single example. Exam There exists just a single example Exam There exists just a single example Exam There exists just a single example Exam There exists just a single example Exam There exists just a single example Exam There exists just a single example Exam What methods exist in the string class to do pattern matching There are several methods that exist in pattern matching. There is match(regular expression), replace( regular expression, replacement text ), split (string literal or regular expression ) and search(regular expression). What are regular expressions Regular expressions are special characters that match or capture portions of a field, as well as the rules that govern all characters (Google.com). Those would be these listed below, Wildcards Anchors Grouping Other Regular Expression to Validate Any Email Address using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions;

namespace Dobro.Text.RegularExpressions
{
/// <summary> /// Example of use of TestEmail class, that validates an E-Mail address. /// </summary> class EmailValidator { static void Main(string[] args) { // init string checkOutput = default(string); // default Email-value string[] emails = new string[] { "ab@206.216.255.255", "ab@206.199.255.255","ab.cc.15@dom1.test.com", "max@120.350.200.15", "max@120.250.200.15" }; // Get Email-value from the arguments array if any if (args.Length > 0) { emails = args; }

// check the all given e-mail strings foreach (string email in emails) { // valiadate e-mail address if (TestEmail.IsEmail(email)) { checkOutput = "valid :)"; } else { checkOutput = "invalid :("; }

// show validation result Console.WriteLine( String.Format("\nThe E-Mail address \"{0}\" is {1}", email, checkOutput)); }

// finally Wait4User2Exit(); }

private static void Wait4User2Exit() { Console.WriteLine("\nPress any key to exit ..."); Console.ReadKey(); } }
}

References:
AIU Online. (2011). ITCO321: Unit 5reliable Output [Multimedia Presentation]. Retrieved from AIU Online Virtual Campus. Data Structures and Implementation ITCO321-1103A-02.
Google.com (2011). What are Regular Expressions. Retrieved August 21, 2011 from http://www.google.com/support/analytics/bin/answer.py?answer=55582
Microsoft.com (2011). How to Search Strings using Regular Expressions. Retrieved August 21, 2011 from http://msdn.microsoft.com/en-us/library/ms228595(v=vs.80).aspx
McMillan, M. (2007). Data Structures and Algorithms Using C#. Cambridge University Press.
Wood, J. (2011). Blackbeltcoder.com Fast Text Search with Boyer-Moore. Retrieved August 21, 2011 from http://www.blackbeltcoder.com/Articles/algorithms/fast-text-search-with-boyer-moore

Similar Documents

Premium Essay

Papers

...Dolendo, MSCS Course Description • Databases are used to store, manipulate, and retrieve data in nearly every type of organization. • Database technology is routinely used by – individuals on personal computers – workgroups accessing databases on network servers – enterprise-wide distributed applications. Course Description • Introduces the basic and fundamental concepts on databases and the management of databases in terms of the different applications. • Exposes the use of DBMS to create and maintain applications. – – – – table construction Forms queries and report generations Course Objectives • Trace the growth and importance of database application; • Identify the advantages and disadvantages of database systems; • Apply appropriate techniques and methodologies in building and maintaining database systems; and • Create database application for business processes....

Words: 2854 - Pages: 12

Premium Essay

Total Quality Management

...|Total quality management implementation and competitive advantage: The role of structural control and exploration | |Thomas J Douglas,  William Q Judge Jr. Academy of Management Journal. ...

Words: 3512 - Pages: 15

Free Essay

Xxxx

...The goal remains to give students a superior foundation in data abstraction, object-oriented programming, and other modern problemsolving techniques. TO THE STUDENT Thousands of students before you have read and learned from Walls and Mirrors . The walls and mirrors in the title represent two fundamental problem-solving techniques that appear throughout the presentation. Data abstraction isolates and hides the implementation details of a module from the rest...

Words: 6423 - Pages: 26

Free Essay

Structure Sesign Pattern

...Bridge: Separates abstract interface from its implementation, which provides a cleaner implementation of real-world objects and allows the implementation details to be changed easily. Composite: used when creating hierarchical object models, this allows clients to treat individual objects uniformly. Decorator: It extends the functionality of individual objects by wrapping them with one or more decorator classes. These decorators can modify existing members and add new methods and properties at run-time. Facade: It is used to provide a high-level interface that makes the subsystem easier to use. It helps to create a unified interface to a set of interfaces in the subsystem. Flyweight: It is used to minimize resource usage when working with very large no. of objects. Proxy: In its most general form it is an interface to something else (Subject class).It can be used when we don’t want to access resource...

Words: 3378 - Pages: 14

Premium Essay

Qi Plan Part Iii

...QI Plan Part III - Implementation and Revision HSC/588 Anna Caluza May 26, 2014 Linda Roan Q I Part III – Implementing and Revising The implementation of correct systems required a team including expert leader’s approach. Effective communications between leaders of Doctor’s Medical Center, end users, the vendors, and the department staff is important when collecting data. For data transfer, authority need to assure that the new system communicate with the existing system. The administrative leaders guide the project activities, data protocol collection, clearly understand roles and responsibilities, and set up policy and procedure. Leader guide the staff to pursue the desire to achieve the goal. In completion of the system, training is provided by trainers for the to staff to be efficient in using the system. A yearly system evaluation to improve quality performance is mandated. The final process of implementation and revising is to assure that the organization is complied with the Joint Commission and other accreditation agencies. Authority Structure and Organization Authority structure is crucial in implementing and revising plans to be successful. To achieve success in implementing project, roles and responsibilities must be organized....

Words: 1181 - Pages: 5

Premium Essay

It- 3rd Year

...UNIT-III Encryption World Wide Web & Security, Encryption, Transaction security, Secret Key Encryption, Public Key Encryption, Virtual Private Network (VPM), Implementation Management Issues. UNIT - IV Electronic Payments Overview of Electronics payments, Digital Token based Electronics payment System, Smart Cards, Credit Card I Debit Card based EPS, Emerging financial Instruments, Home Banking, Online Banking. UNIT-V Net Commerce EDA, EDI Application in Business, Legal requirement in E -Commerce, Introduction to supply Chain Management, CRM, issues in Customer Relationship Management. References: 1. Greenstein and Feinman, “E-Commerce”, TMH 2. Ravi Kalakota, Andrew Whinston, “Frontiers of Electronic Commerce”, Addision Wesley 3. Denieal Amor, “ The E-Business Revolution”, Addision Wesley 4. Diwan, Sharma, “E-Commerce” Excel 5. Bajaj & Nag, “E-Commerce: The Cutting Edge of Business”, TMH INFORMATION SYSTEMS (TIT-502) Unit-I Foundation of Information Systems: Introduction to information system in business, fundamentals of information systems, solving...

Words: 2913 - Pages: 12

Free Essay

Shdkdshfshfshf

...ADT and Time Complexity 1 • • • • • • • • Data and Data Type Abstract Data Type(ADT) Application Level Logical Level Implementation Level Data Structure Data Abstraction Information Hiding 2 Data and Data Type • Data: something that stores information and have operations. • Data Type: a group of data that share same characteristics Example: int is a data type. int i,j. i and j are data, they have operations ++,+,-,x, %. int i,j; i++; i--; 3 Object Description • Consider not a single object but a type of objects with similar properties. • Define each type of objects not by the objects’ physical representation but by their behavior: the services (FEATURES) they offer to the rest of the world. • External, not internal view: ABSTRACT DATA TYPES 4 • There are two companies, each has three employees. We need store information about salary of employees and we want to operations such as increase salary, decrease salary, observe salary. 5 ADT Salary companyA, companyB; companyA.increaseSalary(0.3)// increase salary by 30% companyB.decreaseSalary(0.4)// decrease salary by 40% companyA.ObserveSalary() Salary stores information and have operations, so Salary is a data type. The operations are specified independently of implementation, so Salary is a Abstract Data Type(ADT)....

Words: 382 - Pages: 2

Free Essay

Ds Java

...A Practical Introduction to Data Structures and Algorithm Analysis Third Edition (Java) Clifford A. Shaffer Department of Computer Science Virginia Tech Blacksburg, VA 24061 April 16, 2009 Copyright c 2008 by Clifford A. Shaffer. This document is the draft of a book to be published by Prentice Hall and may not be duplicated without the express written consent of either the author or a representative of the publisher. Contents Preface xiii I Preliminaries 1 1 Data Structures and Algorithms 1.1 A Philosophy of Data Structures 1.1.1 The Need for Data Structures 1.1.2 Costs and Benefits 1.2 Abstract Data Types and Data Structures 1.3 Design Patterns 1.3.1 Flyweight 1.3.2 Visitor 1.3.3 Composite 1.3.4 Strategy 1.4 Problems, Algorithms, and Programs 1.5 Further Reading 1.6 Exercises 3 4 4 6 8 12 13 14 15 16 17 19 21 2 Mathematical Preliminaries 2.1 Sets and Relations 2.2 Miscellaneous Notation 2.3 Logarithms 2.4 Summations and Recurrences 25 25 29 31 33 iii iv Contents 2.5 2.6 2.7 2.8 2.9 3 II 4 Recursion Mathematical Proof Techniques 2.6.1 Direct Proof 2.6.2 Proof by Contradiction 2.6.3 Proof by Mathematical Induction Estimating Further Reading Exercises Algorithm Analysis 3.1 Introduction 3.2 Best, Worst, and Average Cases 3.3 A Faster Computer, or a Faster Algorithm?...

Words: 30587 - Pages: 123

Free Essay

Repitation

...Chapter 6: Binary Trees Objectives Looking ahead – in this chapter, we’ll consider • Trees, Binary Trees, and Binary Search Trees • Implementing Binary Trees • Searching a Binary Search Tree • Tree Traversal • Insertion • Deletion Data Structures and Algorithms in C++, Fourth Edition 2 Objectives (continued) • • • • • • Balancing a Tree Self-Adjusting Trees Heaps Treaps k-d Trees Polish Notation and Expression Trees Data Structures and Algorithms in C++, Fourth Edition 3 Trees, Binary Trees, and Binary Search Trees • While linked lists, stacks, and queues are useful data structures, they do have limitations – Linked lists are linear in form and cannot reflect hierarchically organized data – Stacks and queues are one-dimensional structures and have limited expressiveness • To overcome these limitations, we’ll consider a new data structure, the tree • Trees consist of two components, nodes and arcs (or edges) • Trees are drawn with the root at the top, and “grow” down – The leaves of the tree (also called terminal nodes) are at the bottom of the tree Data Structures and Algorithms in C++, Fourth Edition 4 Trees, Binary Trees, and Binary Search Trees (continued) • Trees can be defined recursively as follows: 1. 2. 3....

Words: 11443 - Pages: 46

Premium Essay

Factor Influencing Implementation of Constituency Development Fund Baord

...ABSTRACT This study seeks to establish the factors influencing implementation of constituency development fund projects in Garisa County. The specific objectives of the study are; to determine the influence of organization’s leadership on...

Words: 10606 - Pages: 43

Free Essay

Management Lessons from Mayo Clinic

...Introduction 4 Hrs Toward higher level languages, Programming paradigms, Language implementation: Bridging the gap, Expression notations, Abstract syntax trees. 2. Types : Data Representation 6 Hrs Elementary data types – Data objects, Variables and Constants, Data types, Declarations, Type checking and type conversion. Numeric data types, Enumerations, Booleans, characters. Structural data types- Structured data objects and data types, Specification of data structure types, Implementation of data structure types, Vectors and arrays, Records, Type equivalence. UNIT II 3. Imperative Programming 6 Hrs Basic statements, Structured sequence control, Handling special cases in loops, Programming with invariants, Proof rules for partial correctness. Procedure activations – simple call-return subprograms, Parameter passing methods, Scope rules for names, Nested scopes in the source text, Activation records, Lexical scope: Procedures as in C. 4. Object- Oriented Programming 4 Hrs Program design with modules, What is an object ?...

Words: 403 - Pages: 2

Premium Essay

Fitter Snacker

...Problems with Fitter Snacker’s Sales Process Fitter-Snacker Case and SAP Configuration • Fitter Snacker has separate information systems for three functional areas: – Sales order processing – Warehouse management – Accounting • Sales transaction data is shared with accounting via periodic file transfers • Credit data is shared between accounting and sales via paper printout – High number of manual transactions leads to many opportunities for data error 4 Overview of Fitter Snacker • Fictitious Fitter Snacker Company produces two snack bars: – NRG-A: “Advanced Energy” – NRG-B: “Body-building proteins” • Fitter Snacker has two sales divisions: – Wholesale: sells to middlemen who distribute bars to small shops, vending machine operators, health food stores – Direct: large grocery stores, sporting goods stores, other large chain stores Sales Process • The Sales Process involves a series of steps that require coordination between: – – – – Sales Warehouse Accounting Receiving • Note that manufacturing is not generally involved in the sales process as NRG bars are usually sold from warehouse stock 2 5 Overview of Fitter Snacker Sales Process • Direct Sales: offers volume discounts to encourage large orders which are more efficient to process • Wholesale: charges lower fixed price because customer orders are already large (otherwise, the customer would be handled by Direct division) • Both divisions offer......

Words: 2501 - Pages: 11

Premium Essay

Abc System

...Academics who advocate ABC, such as, Cooper and Kaplan [9], and Swenson [10] argue that it provides more accurate cost data needed to make appropriate strategic decisions about product mix, sourcing, pricing, process improvement, and evaluation of business process performance. These claims have led many firms to adopt ABC systems [8]. The benefits of ABC and its positive impact on firm’s performance motivated a numerous studies which examined various aspects of ABC. Among such studies are McGowan [11] who assessed the integrity of ABC success, Innes and Mitchell [4, 12] and Yanren [13] who conducted research on factors affecting ABC adoption, and Shield [3], Shields and McEwen [14], Gosselin [15] and Baired et al.[16, 17]who concentrated on factors influencing ABC success especially at the implementation stage. However, there is mounting evidence that suggests most of firms are experiencing problems in implementing ABC and, in some extreme cases, ABC implementation is not successful [3], which later resulted in abandoning the ABC systems altogether [15]. Questions arise as to why ABC implementation is successful in certain companies and fails in others. Based on the contingency theory, researchers have argued that the reasons for different degrees of ABC success could be due to the different contextual factors faced by each firm. These have led researchers to recognize assessing factors that influence ABC success implementation as an important research area....

Words: 6138 - Pages: 25

Premium Essay

Data Systems Learning Team Paper

...University of Phoenix Data Systems Learning Team Paper Team A: HCI 520 Data Management and Design January 16, 2012 Introduction This paper will address data systems; a database is an organized group of files that are related. It is maintained and considered an integral part of most organizations worldwide. In Data Base Management, programs enable you to store, modify, and extract information from a database. In this paper team A will address database types, demonstrate a conceptual representation for a database system. We focused on relational data model to explain how DBMS organizes information in different formats and design models. Implementation of a Database System The purpose of the implementation phase is to make the new system available to a prepared set of users. In this phase the construction and installation of the new database system is initiated according to the plan and design that represents all aspects of the organization, including its interactions with the external environment, this requires matching the design requirements with the best available implementing tools and then using those tools for the implementation. There are several basic steps to implementation of a database system....

Words: 3000 - Pages: 12

Premium Essay

Data Sysytems

...University of Phoenix Data Systems Learning Team Paper Team A: Renee Wilson, Ferdinand Habijan, Maryrose DeFino, Stasia Bowling HCI 520 Data Management and Design January 16, 2012 Steven Fowler Introduction This paper will address data systems; a database is an organized group of files that are related and considered the supporting constructs of a database management system. It is maintained and considered an integral part of most organizations worldwide. The database management system houses a program that enables storage, modification, and extraction of information from a database. In this paper team A will address database the phases of the database life cycle, and provide a conceptual representation for a database system. Team A focused on relational data model utilizing the Oracle database management system. Implementation of a Database System The purpose of the implementation phase is to make the new system available to a prepared set of users. In this phase the construction and installation of the new database system is initiated according to the plan and design that represents all aspects of the organization, including its interactions with the external environment, this requires matching the design requirements with the best available implementing tools and then using those tools for the implementation. There are several basic steps to implementation of a database system....

Words: 2836 - Pages: 12