Free Essay

Data Structure

In:

Submitted By apaman
Words 2466
Pages 10
DATA STRUCTURES
ANALYSIS OF ALGORITHMS
Definition:-
The method of solving a problem is known as an algorithm.It is a sequence of instructions that act on some input data to produce some output in a finite number of steps.
Properties:-
a) Input:An algorithm must receive some input data supplied externally.
b)Output:An algorithm must produce atleast one output as the result.
c)Finiteness:The algorithm must terminate after a finite number of steps.
d)Definiteness:The steps to be performed in the algorithm must be clear and unambiguous.
e)Effectiveness:One must be able to perform the steps in the algorithm without applying any intelligence. All algorithms basically fall under two broad categories-Iterative and Recursive algorithms. Iterative Algorithms typically use loops and conditional statements. Recursive Algorithms use a divide and Conquer strategy. As per this,the recursive algorithm breaks down a large problem into small pieces and then applies the algorithm to each of these smal pieces. Determining which algorithm is efficient than the other involves analysis of algorithms. While analyzing,time required to execute it determined .’time’ represents the number of operations that are carried out while executing the algorithm. While analyzing iterative algorithms we need to determine how many times the loop is executed. To analyze a recursive algorithm one needs to determine amount of work done for three things:
i.breaking down the large problem to smaller pieces. ii.Getting solution for each piece and combining the individual solutions to get the solution to the whole problem. iii.Combining this information and the number of the smaller pieces and their sizes,we then need to create a recurrence relation for the algorithm.
Analysis:-
The analysis of an algorithm provides information that gives us a general idea of how long an algorithm willtake for solving a problem.For comparing the performance of two algorithms we have to esimate the time taken to solve a problem using each algorithm for a set of N input values. Analysis of algorithms give us the scientific reason to determine which algorithm should be chosen to solve the problem. The purpose of determining the number of comparisions is to then use them to figure out which of the algorithms under consideration can solve the problem more efficiently.
What Analysis Doesn’t Do:-
The analysis of algorithms does not give a formula that helps us determine how amny seconds or computer cycles a particular algorithm will take to solve a problem. The analysis of algorithm should be done regardless of the computer on which the program that implements the algorithm is going to get executed.
Things to Count and Consider:- i.The significant operation or operations in the algorithm must be identified first. ii.Operations integral to the algorithm and which merely contribute to the overheads should be determined next. Comparision or arithmetic are two classes of operations that typically chosen for the significant operation.
Cases To Consider During Analysis:- Multiple input sets must be considered while analyzing an algorithm. a)Best Case Input:- This represents the input set that allows an algorithm to perform most quickly with this input the algorithm takes shortest time to execute, as it causes the algorithms to do the least amount of work. No matter how large is the input,searching in a best case will result in a constant time of 1. Since the best case for an algorithm would usually be very small and frequently constant value,a best case analysis is often not done. b)Worst Case Input: This represents the input set that allows an algorithm to perform more slowly.Worst case is an important analysis because it gives us an idea of the most time an algorithm will ever take. Worst case analysis requires that we identify the input values that cause an algorithm to de the most work. c)Average Case Input: This represents the input ser that allows an algorithm to deliver an average performance. Doing average case analysis is a four step process.
These steps are as follows: i.Determine the number of different groups into which all possible input sets can be divided. ii.Determine the probability that the input will come from each of these groups. iii.Determine how long the algorithm will run for each of these groups. All of the input in each group should take the same amount of time,amd if they do not,the group must be split into separate groups.
Calculate average case time using the formula: m A(n)=∑pi*ti where i=1 n=size of input m=number of groups pi=probability that the input will be from group i

ti= time that the algorithm takes for input from group i.
Rates Of Growth:- While doing analysis of algorithm we must consider what happens when the size of the input is large, because small input sets can hide rather dramatic differences.
Algorithms can be groped into three categories based on the order of the function or related algorithm. a)Algorithm that grow atleast as fast as same function. b)Algorithms that grow at the same rate. c)Algorithms that grow no faster. The categories mentioned above are commenly known as Big Omega Ω (f),Big oh O(f) and Big Theta Ө(f) respectively. Of these, the Big Omega category of functions is not of much interest o us since for all values of ‘n’ greater than same threshold value no all the functions in Ω (f) have values that are at least as large as f(i.e) all functions in this category grow as fast as f or even faster. Big Oh O(f) category represents the class of functions that grow no faster than f. This means that for al values of n greater than same threshould number all the functions in O(f) have values that are no greater than f.
Analysis of sequential search Algorithms:
Sequential Search looks at elements,one at a time,from the first in the list until a match is found .It returns the index of where the value being searched is found. If the value is not found the algorithm returns an index value that is outside the range of the list of elements.
Assuming that the elements of the list are located in positions 0 to N-1 in the list, we can return a value-1 if the element being searched is not in the list.
Sequentialsearch (list,value,N)
List-the elements to be searched value-the elementto be searched for n- the number of elements in the list for i=1 to N do
If(value=list[i])
returm i end if end for return 0
Worst Case Analysis:
These are two worst case for the sequential search algorithm:
-The value being searched matches the last element in the list
-The value being searched is not present in the list.
Average Case Analysis:
There are two average case analyzes that can be done for a search algorithm. The first assumes that the search is always successful and the other assumes that the value being searched will sometimes not be found.
Performance Analysis:
Criteria upon which can judge an algorithm includes.
1.Does it do what we want it to do
2.Does it work correctly according to the original specifications of the task?
3.Is there documentation that describes how to use it and how it works?
4.Are procedures created in such a way that they perform logical sub functions?
5.Is the code readable?
These are other criteria for judging algorithms that have a more direct relationship to performance. These have to do with their computing times and storage requirements.
Space Complexity:
The space complexity of an algorithm is the amount of memory it needs to run to completion.
1)Example: Algorithm abc(a,b,c)
{
return a+b+b*c+(a+b-c)/(a+b)+4.0;
}
Algorithm abc computes a+b+b*c+(a+b-c)/(a+b)+4.0;
2)Example: Algorithm sum(a,n)
[ s:=0.0; for i:=1 to n do s:=s+a[i]; return s;
}
n
Algorithm sum computes ∑a[i] iteratively where the a[i] s are real numbers. I=1

3)Example: Algorithm Rsum(a,n)
{
if(n=100n for n>=1
3)Definition:-[Theta]
The function f(n)= Ó¨ (g(n)) iff there exists positive constants c1, c2 and n0 such that c1g(n)=3n for all n>=2 and 3n+2=2,so c1=3,c2=4 and n0 =2.
The theta notation is more precise than both big oh and omega notations.
4)Definition:-[little oh] The function f(n)= o(g(n)) iff lim f(n)/g(n) =0 n->∞
Ex:3n+2=o(n²) since lim 3n+2/n2 =0 n->∞

5)Definition:-[little omega] The function f(n)= w(g(n)) iff lim g(n)/f(n) =0 n->∞

The BIG OH NOTATION:
If f(n) and g(n) are functions defined for positive integers,then to write f(n) is O(g(n)) which means that there exists a constant C such that |f(n)|f(n)-O(g(n)) if there exists two constants C and no such that |f(n)|= no .
Utility:
f(n) will normally represent the computing time of some algorithm. When we say that the computing time of an algorithm is O(g(n)) we mean that its execution takes no more than a constant times g(n).n is a parameter which characterizes the input and/or output.
i)Big O is transitive:-
It is easy to show that if f(n) is O(g(n)) is O(h(n)),f(n) s O(h(n)).
e.g:n³+100n is O(n²),n² is and O( n³ ) consequently n² +100n is O( n³ ). This is called transitive property. ii)Big O is multiplicative:
A constant computing time is referred to as O(1),O(1) is better than O(n),which in tern is better than O(n²).O(n³)is worse and O(2^n) is awful.
One other frequently seen computing time is O(log n base 2)which is better than O(n).
Its complexity increases in multiple as n increases,hence it is multiplicative. Total number of key comparisons by Quick Sort algorithm for an unordered array is O(nlog n) and for ordered array is O(n²).
For an unsorted array if we are lucky then each time a record is correctly positioned the subfile to its left will be of the same size as that to its right. This would leave us with the sorting of two subfiles each of size roughly n/2. The time required to position a record in the file of size n is O(n). If T(n) is the time taken to sort a file of n records then when the file splits roughly into two equal parts each time a record is positioned correctly we have
T(n)infinitef(n)/g(n)=0
7)The function f(n)=w(g(n)) iff

a)lim n->infiniteg(n)/f(n)=1 b)lim n->infiniteg(n)/f(n)=0 c)lim n->0g(n)/f(n)=1 d)lim n->0g(n)/f(n)=0 8)The running time of an algorithm is given by T(n)=T(n-1)+T(n-2)-T(n-3),if n›3 n,otherwise. The order is a)n b)log n c)nn d)n2 9)What should be the relation between T(1),T(2) and T(3),so that above question gives an algorithm[a] a)T(1)=T(2)=T(3) b)T(1)+T(3)=2T(2) c)T(1)-T(3)=T(2) d)T(1)+T(2)=T(3) 10) Time complexity of an algorithm T(n),where n is the input size is given by T(n)=T(n-1),where n is the input size is given by T9n)=T(n-1)+1/n,if n› =1,otherwise The order of this algorithm is[a] a)log n b)n c)n2 d)nn 11)Which of the following sorting algorithm has the worst time complexity of nlog n?[a] a)heap sort b)Quichk sort c)Insert sort d) Selection sort 12) THe concept of order (Big O) is important because [d] a)it can be used to decide the best algorithm that solves a given problem b)it determines the maximum size of a problem that can be solved in a given amount of time. c)it is the lower bound of the growth rate of algorithm d)both (a) and (b)above 13)The running time T(n),where n is the input size of a recursive algorithm is given[b] T(n)=c+T(n-1),if n› =d,if n‹=1 The order of the algorithm is a)n2 b)n c)n3 d)nn Ex: Recursively applying the relation,we finally get T(n+1)=C(n-1)+t(1)=C(n-1)+d hence order is n. 14) Consider the following two functions f(n)=n3, if 0‹=n‹10,000 =n2,otherwise g(n)=n,if 0‹=n‹100 =n2+5n,otherwise which of the following are true.[c,d] a)f(n) is O(g(n)) b)g(n)is O(n3) c)O(f(n))is same as O(g(n)) d)g(n) is O(n2) 15)An algorithm is made up of 2 modules M1 and M2.If order of M1 is f(n) and M then the order of the algorithm is[a] a)max(f(n),g(n)) b)min(f(n),g(n)) c)f(n)+g(n) d)f(n)*g(n) By definition of order ,there exists constants c1,c2,n1n2such that T(n)‹=c1*f(n),for all n‹=n1 T(n)‹=c2*g(n),for all n‹=n2 Let N=max(n1,n2) and c=max(c1,c2) so, T(n)‹=c*f(n),for all n‹=N T(n)‹=c*g(n),for all n‹=N Adding T(n)‹=c/2*(f(n)+g(n)) withhout loss of generality,let max(f(n),g(n))=f(n) T(n)‹=c/2(f(n)+f(n))‹=c*f(n) so,order is f(n),which is max(f(n),g(n)),by our assumption. 16)Big O is[c] a)multiplicative b)transitive c)both d)none of these

Questions:
1.Determine the frequency counts for all statements in the following two algorithm segments:
1.for i:=1 to n do 1.i:=1;
2.for j:=1 to i do 2.while(in); i:=1; while(i

Similar Documents

Free Essay

Data Structures

...Data Structures and Algorithms DSA Annotated Reference with Examples Granville Barne Luca Del Tongo Data Structures and Algorithms: Annotated Reference with Examples First Edition Copyright c Granville Barnett, and Luca Del Tongo 2008. This book is made exclusively available from DotNetSlackers (http://dotnetslackers.com/) the place for .NET articles, and news from some of the leading minds in the software industry. Contents 1 Introduction 1.1 What this book is, and what it isn’t . . . 1.2 Assumed knowledge . . . . . . . . . . . . 1.2.1 Big Oh notation . . . . . . . . . . 1.2.2 Imperative programming language 1.2.3 Object oriented concepts . . . . . 1.3 Pseudocode . . . . . . . . . . . . . . . . . 1.4 Tips for working through the examples . . 1.5 Book outline . . . . . . . . . . . . . . . . 1.6 Testing . . . . . . . . . . . . . . . . . . . 1.7 Where can I get the code? . . . . . . . . . 1.8 Final messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 3 4 4 6 6 7 7 7 I Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . reverse order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

Words: 23014 - Pages: 93

Free Essay

Data Structures

...Data Structures & Algorithms Coursework Assignment 1 Q1. (a) Algorithm swap(x, y): Node n head While (n.getNext () != x ) do n n.getNext() Node v y.getNext () n.setNext(y) y.setNext(x) x.setNext(v) (b) Algorithm swap Doubly(x, y): DNode n x.getPrev() DNode v y.getPrev() n.setNext(y) y.setPrev(n) y.setNext(x) x.setPrev(y) x.setNext(v) v.setPrev(x) (c) The run time complexity for the singled linked algorithm is O (n) and for the doubly linked algorithm is O (1). Doubly linked list has the best time complexity. Time complexity in singly linked list take more time because we have to move from head to the node before x Q2. (b) RedBlueStack implements Stack{ protected Object A[]; Int capacity; int top = -1; RedBlueStack(int cap) { A = new Object [capacity]; capacity = cap; } int size() { return (top + 1); } void push(Object obj) throws FullStackException { if (size() == capacity) throws new FullStackException("Stack is full."); A[++top] = obj; } Object top() throws EmptyStackException { if (isEmpty()) throws new EmptyStackException("Stack is empty."); return A[top]; } Boolean isEmpty() { return (top < 0); } Object top() throws EmptyStackException { if (isEmpty()) throws new EmptyStackException("Stack is empty."); return A[top]; }  Object pop() throws EmptyStackException { Object elem; if (isEmpty()) throws new EmptyStackException("Stack...

Words: 551 - Pages: 3

Free Essay

Non Linear Data Structure

...What is a non-linear datastructure? A non-linear datastrucutre is a datastructure in which the data items in the memory are not allocated contiguously i.e. the data items are dispersed in the memory. The first data item will have a link to the second data item and second data item will have a link to the third data item and so on. Pros • Uses memory efficiently that the free contiguous memory in not an requirement for allocating data items • The length of the data items is not necessary to be known prior to allocation Cons • Overhead of the link to the next data item Linked list: linked list a data structure which stores data in the form of nodes.It does not require linear memory as arrays. Each node contains a data part and a pointer part(a pointer to the next data in the list) link or node is object of a class.there are so many types of linked list 1) single linked list 2)doubly linked list 3)circular linked list. single linked list: here links contains pointer to first data and last data in the list.As said earlier a pointer to the next data. example of a linked list: class node{// all nodes will be the objects of this class public int data; public link next_node;//a pointer to next data } public node(int data){ this.data=data; }//end of constructor public void showdata(){ System.out.println("data= "+data); } }//end of class node After defining class for each node we need to define a class for link list. Link list contains a pointer to...

Words: 475 - Pages: 2

Premium Essay

Data Structure

...stack. AB-CD+E*+ (where A=5, B=3, C=5, D =4, and E=2) Question 5 Evaluate the following postfix expression using a stack and show the contents of stack after execution of each operation : 50,40,+,18, 14,-, *,+ Question 6 Evaluate the following postfix expression using a stack and show the contents of stack after execution of each operation : TRUE, FALSE, TRUE, FALSE, NOT, OR, TRUE, OR, OR, AND Question 7 Write a program for creating polynomial using linked list? Question 8 Each node of a STACK contains the following information, in addition to required pointer field : i) Roll number of the student ii) Age of the student Give the structure of node for the linked stack in question TOP is a pointer which points to the topmost node of the STACK. Write the following functions. i) PUSH() - To push a node to the stack which is allocated dynamically ii) POP() - To remove a node from the stack and release the memory. Question 9 Write a function in C to perform a DELETE operation in a dynamically allocated link list considering the following description : struct Node { float...

Words: 308 - Pages: 2

Free Essay

Data Structures

...Chapter 1 Basic Networking Chapter 1 Basic Networking:                      Data communication is the transfer of data from one device to another via some form of transmission medium. A data communications system must transmit data to the correct destination in an accurate and timely manner. The five components that make up a data communications system are the message, sender, receiver, medium, and protocol. Text, numbers, images, audio, and video are different forms of information. Data flow between two devices can occur in one of three ways: simplex, halfduplex, or full-duplex. A network is a set of communication devices connected by media links. In a point-to-point connection, two and only two devices are connected by a dedicated link. In a multipoint connection, three or more devices share a link. Topology refers to the physical or logical arrangement of a network. Devices may be arranged in a mesh, star, bus, or ring topology. A network can be categorized as a local area network (LAN), a metropolitan-area network (MAN), or a wide area network (WAN). A LAN is a data communication system within a building, plant, or campus, or between nearby buildings. A MAN is a data communication system covering an area the size of a town or city. A WAN is a data communication system spanning states, countries, or the whole world. An internet is a network of networks. The Internet is a collection of many separate networks. TCP/IP is the protocol suite for the Internet...

Words: 2538 - Pages: 11

Free Essay

Treap Data Structure

...as shown in figure 1, is a binary tree data structure which is used to hold key-value pairs and satisfies following properties; • The left subtree of any node contains only those nodes with keys less than the node’s key. • The right subtree of any node contains only those nodes with keys greater than the node’s key. key=10 val="AU" key=8 val="BN" key=15 val="TN" key=12 val="NZ" key=17 val="DL" key=19 val="IN" Figure 1: An example Binary Search Tree These ordering constraints help to find out a node with a given key in O(log n) average time. Insertion and deletion operations in BST (Binary search tree) must maintain these ordering constraints. prio: 8 val: "IN" prio: 15 val: "NZ" prio: 18 val: "AU" prio: 25 val: "TN" prio: 30 val: "BN" prio: 20 val: "AP" prio: 22 val: "RS" Figure 2: An example min-heap Heap is an another binary tree data structure, as shown in figure 2, which is useful in sorting (heapsort) and implementing a priority queue. A heap can be a min-heap or a max-heap based on the priority of a node with respect to the 1 priority of its left and right children. In case of min-heap each node has lesser priority than its children. In case of max-heap each node has higher priority than its children. In this assignment we are going to implement a binary tree data structure which is a combination of BST and heap. This data structure is called Treap. Treap Treap is a binary tree data structure where each node contains 3 attributes;...

Words: 1803 - Pages: 8

Free Essay

Analysis Algorithm and Data Structure

...1.2. Representation of integer has no size restriction • The important factor affecting the running time is normally size of the input. • Normally the built in data type has a fixed size, to enter and to store the larger data. • The Linked List can be used to store the integer without size restriction, which stores each digit in nodes. • The data can also be reused. Addition: A= 456 Represented by 6 → 5 → 4 in linked list B= 094 Represented by 4 → 9 → 0 in linked list The Resultant is C = 550 Represented by 0 → 5 → 5 in linked list. Multiplication: A= 123 * B= 456 A= Represented by 3 → 2 → 1 in linked list. B= Represented by 6 → 5 → 4 in linked list. STEP 1: 123 * 6 = 8 → 3 → 7 in linked list. STEP 2: 123 * 50= 0 → 5 → 1 → 6 in linked list. STEP 3: ADD STEP 1 AND STEP 2 8 → 8 → 8 → 6 in linked list. STEP 4: 123 * 400= 0 → 0 → 2 → 9 → 4 in linked list. STEP 5: ADD STEP 3 AND STEP 4 8 → 8 → 0 → 6 → 5 in linked list. Exponentiation: The initial step is to arrange in decreasing order of exponents and then perform the action. The other method is by using Θ(log n) time algorithm based on binary representation. 1.5. Representation of one’s and two’s complement 1’s complement: + 4= 0100 - 4= 1011 (taking 1’s complement of +4 is -4 (i.e.) inverting the bit). So, 1’s complement is used to represent both positive and negative integers. 2’s complement: Converting the value to 1’s complement and then adding 1 to that complement. ...

Words: 473 - Pages: 2

Free Essay

C++ Data Structures

...C++ Data Structures Chapter 1 10) What is the difference between an object and an object class? An object class provides the blue print for an object. It will define everything and all the variables and methods available to an object (at least in non-dynamic languages). An object is an instance of an object class, which provides a living breathing representation of that blue print. Example #1 A Toyota Camry or another particular make might be an instance of the class car. Example #2 A house might be an instance of the class Building 17) The following program has three separate errors, each of which would cause an infinite loop. As a member of the inspection team, you could save the programmer a lot of testing time by finding the errors during the inspection. Can you help? Error 1: The while clause is missing the {} brackets around the next 3 lines. Error 2: The Increment function is getting passed the variable nextNumber by value rather than reference, which will not increment count in the main() function. Error 3: The program is not referencing stdlib 18) Is there any way a single programmer (for example, a student working alone on a programming assignment) can benefit from some of the ideas behind the inspection process? Yes, I believe anyone could benefit from the inspection process, regardless of the size of the team. The whole philosophy behind the inspection process is to review a program to ensure that each piece is working...

Words: 347 - Pages: 2

Free Essay

The Data Structure

...数据结构基本英语词汇 I like ITPUB! 数据结构基本英语词汇 数据抽象 data abstraction 数据元素 data element 数据对象 data object 数据项 data item 数据类型 data type 抽象数据类型 abstract data type 逻辑结构 logical structure 物理结构 phyical structure 线性结构 linear structure 非线性结构 nonlinear structure 基本数据类型 atomic data type 固定聚合数据类型 fixed-aggregate data type 可变聚合数据类型 variable-aggregate data type 线性表 linear list 栈 stack 队列 queue 串 string 数组 array 树 tree 图 grabh 查找,线索 searching 更新 updating 排序(分类) sorting 插入 insertion 删除 deletion 前趋 predecessor 后继 successor 直接前趋 immediate predecessor 直接后继 immediate successor 双端列表 deque(double-ended queue) 循环队列 cirular queue 指针 pointer 先进先出表(队列) first-in first-out list 后进先出表(队列) last-in first-out list 栈底 bottom 栈定 top 压入 push 弹出 pop 队头 front 队尾 rear 上溢 overflow 下溢 underflow 数组 array 矩阵 matrix 多维数组 multi-dimentional array 以行为主的顺序分配 row major order 以列为主的顺序分配 column major order 三角矩阵 truangular matrix 对称矩阵 symmetric matrix 稀疏矩阵 sparse matrix 转置矩阵 transposed matrix 链表 linked list 线性链表 linear linked list 单链表 single linked list 多重链表 multilinked list 循环链表 circular linked list 双向链表 doubly linked list 十字链表 orthogonal list 广义表 generalized list 链 link 指针域 pointer field 链域 link field 头结点 head node 头指针 head pointer 尾指针 tail pointer 串 string 空白(空格)串 blank string 空串(零串) null string 子串 substring 树 tree 子树 subtree 森林 forest 根 root 叶子 leaf 结点 node 深度 depth 层次 level 双亲 parents 孩子 children 兄弟 brother 祖先 ancestor 子孙 descentdant ...

Words: 1522 - Pages: 7

Free Essay

Ibm Db2

...processors and supports up to 2GB of system memory. Insights gained from working with the database after installed are also shared. Installation Process for DB2 Express-C Downloading and installing DB2 Express-C is easily accomplished over an Internet connection. The version installed is 389MB and took approximately 10 minutes to download over a cable modem running at fractional T1 speeds. Installation screens from the steps completed to get DB2 Express-C up and running are shown in the Appendix of this document. After installing the Control Center was invoked at the command line using the command db2cc which is specifically defined in the chapter assigned on DB2 Express-C. Using the command db2sampl -xml –sql to create the sample data worked, and there is the secondary option of using graphical interface commands to accomplish the same. The use of the DB2 Command Line tools show how quickly a multidimensional table can be viewed, edited and batch programming tasks completed using shell scripts in this interface. IBM has done an excellent job of making this free version of DB2 as fully featured and full of navigational and command options as possible. What is most significant amount the design of DB2 relative to other databases worked with is the multiple approaches to getting commands invoked the flexibility on creating fully automated responses to queries, or the option of...

Words: 728 - Pages: 3

Premium Essay

Test

...This general problem is known as the vehicle routing problem.Solving the vehicle routing problem involves determining how many vehicles are required to service the destinations, and developing a route and schedule for each one. Because there are many variations of the problem, it can be very dillicult to solve. TransCAD provides a rich set of vehicle routing tools that solve various types of routing problerns,These tools are used to prepare input data, solve the routing problem, and provide tabular and graphical output of the resulting routes and vehicle schedules. The starting points for each route (such as the warehouse in the above example) are known as depots, and the points to be visited are known as stops. A vehicle route starts at a depot, visits one ormore stops, and may or may not return to the depot. The goal of the procedure is to obtain a set of routes that minimizes the total time or discance traveled by the entire fleet of vehicles. The travel times or distances are stored in the vehicle routing matrix.You can use a network to calculate the network driving time or distance, or you can use straight line distances to create your vehicle routing matrix. You must use a network-based vehicle routing matrix if you want to display the routes on a map as a route system layer.Time window- There are time restrictions on when deliveries can be made to some or all of the stores Each stop requires a certain amount of time to service. The service time can have a fixed component...

Words: 3610 - Pages: 15

Free Essay

Continuous Skyline Queries for Moving Objects

...Omar Khairy El -Morsy ABSTRACT The literature on the skyline algorithms so far mainly deal with queries for static query points over static datasets. With the increasing number of mobile service applications and users, the need for continuous skyline query processing has become more pressing. The continuous skyline operator involves not only static but also dynamic dimensions. In this paper, we examine the spatio-temporal coherence of the problem and propose a continuous skyline query processing strategy for moving query points. First, we distinguish the data points that are permanently in the skyline and use them to derive a search bound. Second, we investigate into the connection between data points’ spatial positions and their dominance relationship, which provides an indication on where to find changes of skyline and how to update the skyline continuously. Based on the analysis, we propose a kinetic-based data structure and an efficient skyline query processing algorithm. We analyze the space and time costs of the proposed method and conduct an extensive experiment to evaluate the proposal. To the best of our knowledge, this is the first work on continuous skyline query processing. shown in Figure 1, there are a set of hotels and for each hotel, we have its distance from the beach (x axis) and its price (y axis). The interesting hotels are all the points not worse than any other point in both distance from the beach and the price. Hotels 2, 4 and 6 are interesting and can...

Words: 11922 - Pages: 48

Free Essay

Data Structures and Implementation

...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...

Words: 730 - Pages: 3

Premium Essay

Benefits of Social Networking

...Chapter 6 Basic data structures A data structure, sometimes called data type, can be thought of as a category of data. Integer is a data category which can only contain integers. String is a data category holding only strings. A data structure not only defines what elements it may contain, it also supports a set of operations on these elements, such as addition or multiplication. Strings and numbers are the core data structures in Python. In this chapter, you’ll see a few more, almost as important, data structures. In the next chapter, you’ll se how you can design your own, customary data structures. The concept of a sequence is so fundamental to programming that I’ve had a very hard time avoiding it so far. And as you, alert and perky, have noticed, I actually haven’t, since I involuntarily had to introduce sequences in Section 4.4 when talking about the for loop. In Python, the word “sequence” covers several phenomena. Strings are sequences of characters, and you heard about those in Chapter 3. In the coming sections, you’ll hear about the two other basic types of sequence supported by Python: Lists and tuples. Later in this chapter, we’ll get around to talking about sets and dictionaries. Strings and integers represent concrete data objects; a string or a number represents true data in itself.1 Lists, tuples and dictionaries are designed to organize other data, to impose structure upon it; they do not necessarily represent true data in their own right. For this reason, they...

Words: 18297 - Pages: 74

Free Essay

Mountain View Community Hospital

...Case Study Mountain vew community hospital Case Study Mountain vew community hospital 2014 Case Study: Mountain View Community Hospital 1. Mountain View Community Hospital (MVCH) wants to provide better services than their current deliverables. Therefore, databases can help MVCH reach their goal through making relational applications provide information about clients or patients without having a book or paperwork to search for every time. A centralized database application that is not a conjunction of separate applications makes information fluid and accessible without much of a hassle. For example, when a surgeon at MVCH would want information of a patient who has visited before, the surgeon could run an application on a handheld device that collects information from the database. At the same time, when the doctor is checking the file information on the patient, the nurse or other staff member can also access the information of the patient to know what is wrong with the patient exactly. This was, the efficiency of doctors and other members of the hospital can work in collaboration flawlessly. If the database is managed well, when government inspections are taken, the hospital can provide the required information as soon as possible, keeping the hospital’s integrity to the mark with the government. 2. Database technology can take various forms when it comes to complying with security standards of patients and their information. Firstly, the database can hold...

Words: 850 - Pages: 4