Vous êtes sur la page 1sur 7

1.(A)Write the need for modeling.Specify the principles of modeling. (B)Explain the architecture of UML. 2.

(A)How do u model a vocabulary of a system in UML. (B)What r the common properties and uses of class daigrams. 3.(A)Compare & contrast sequence and collaboration daigrams.Discuss how we can model polymorphism in UML. (B)Explain how call-back mechanism is depicted in UML,Illustrate. 4.(A)Explain the unified process which is architeture centric in UML. (B)Discuss the diff relationships used in class daigrams with suitable example. 5.(A)What is the significance of usecase diagrams & activity daigrams in UML (B)Explain how 2 model life time of an abject in UML 6.Explain SDLC of unified process in UML. 7.Explain conceptual model of UML. 8. ,, Object oriented concepts with real time examples.

CSD
COMPUTER SYSTEM DESIGN -------------------------1st unit------------1.Explain IA-Pentium registers. 2.Explain Von-Neumann architecture in detail. 3.Explain IA-32 Pentium instructions. 4.Explain IA-32 Pentium addressing modes. ----------5th unit------------1.How user authentication is provided for data information systems. 2.Explain different categories of directory structure & implementation in detail.

SDE Software Design & Engg. ------------------------------------1.A) How iterative enhancement model is helpful during maintenance? Explain various stage cycles of this model? B) Discuss prototype model what is the effect of designing a prototype on the overall cost of the project? 2. List some of the desirable characteristics of a good SRS document specification list important issues which an SRS must address. 3. A) what are the objectives of s/w design? How do we transform an informal design into a detailed design? B) What is cohesion? What are the problems are likely to arise if modules have low cohesion? 4. What are the essential characteristics of s/w engg.? How it is different from other engg. Discipline such as house building and bridge design. 5.A) List and discuss the major quality requirements of s/w specification document. B) What are the title major uses of requirement specification document~ In what ways these uses affect the style and content of a requirement document. 6.A) Name the widely used s/w design methods and give a detailed sketch of data flow design methods. B) Explain the notation of coupling and cohesion in the content of structured design.

Big-O Notation Big-O is the formal method of expressing the upper bound of an algorithm's running time. It's a measure of the longest amount of time it could possibly take for the algorithm to complete. More formally, for non-negative functions, f(n) and g(n), if there exists an integer n0 and a constant c > 0 such that for all integers n > n0, f(n) cg(n), then f(n) is Big O of g(n). This is denoted as "f(n) = O(g(n))". If graphed, g(n) serves as an upper bound to the curve you are analyzing, f(n).

Note that if f can take on finite values only (as it should happen normally) then this definition implies that there exists some constant C (potentially larger than c) such that for all values of n, f(n) Cg(n). An appropriate value for C is the maximum of c and . Big-Omega Notation For non-negative functions, f(n) and g(n), if there exists an integer n0 and a constant c > 0 such that for all integers n > n0, f(n) cg(n), then f(n) is omega of g(n). This is denoted as "f(n) = (g(n))". This is almost the same definition as Big Oh, except that "f(n) cg(n)", this makes g(n) a lower bound function, instead of an upper bound function. It describes the best that can happen for a given data size. Theta Notation For non-negative functions, f(n) and g(n), f(n) is theta of g(n) if and only if f(n) = O(g(n)) and f(n) = (g(n)). This is denoted as "f(n) = (g(n))". This is basically saying that the function, f(n) is bounded both from the top and bottom by the same function, g(n). queue as a linked list 2b. implement a queue as a linked list

import java.io.*; import java.util.*; public class QueueImplement{ LinkedList<Integer> list; String str; int num; public static void main(String[] args){ QueueImplement q = new QueueImplement(); } public QueueImplement(){ try{ list = new LinkedList<Integer>(); InputStreamReader ir = new InputStreamReader(System.in); BufferedReader bf = new BufferedReader(ir); System.out.println("Enter number of elements : "); str = bf.readLine(); if((num = Integer.parseInt(str)) == 0){ System.out.println("You have entered either zero/null."); System.exit(0); } else{ System.out.println("Enter elements : "); for(int i = 0; i < num; i++){ str = bf.readLine(); int n = Integer.parseInt(str); list.add(n); } } System.out.println("First element :" + list.removeFirst()); System.out.println("Last element :" + list.removeLast()); System.out.println("Rest elements in the list :"); while(!list.isEmpty()){ System.out.print(list.remove() + "\t"); } } catch(IOException e){ System.out.println(e.getMessage() + " is not a legal entry."); System.exit(0); } } } oops concepts Java is a object oriented programming and to understand the functionality of OOP in Java, we first need to understand several fundamentals related to objects. These include class, method, inheritance, encapsulation, abstraction, polymorphism etc. Class - It is the central point of OOP and that contains data and codes with behavior. In Java everything happens within class and it describes a set of objects with common behavior. The class definition describes all the properties, behavior, and identity of objects

present within that class. As far as types of classes are concerned, there are predefined classes in languages like C++ and Pascal. But in Java one can define his/her own types with data and code. Object - Objects are the basic unit of object orientation with behavior, identity. As we mentioned above, these are part of a class but are not the same. An object is expressed by the variable and methods within the objects. Again these variables and methods are distinguished from each other as instant variables, instant methods and class variable and class methods. Methods - We know that a class can define both attributes and behaviors. Again attributes are defined by variables and behaviors are represented by methods. In other words, methods define the abilities of an object. Inheritance - This is the mechanism of organizing and structuring software program. Though objects are distinguished from each other by some additional features but there are objects that share certain things common. In object oriented programming classes can inherit some common behavior and state from others. Inheritance in OOP allows to define a general class and later to organize some other classes simply adding some details with the old class definition. This saves work as the special class inherits all the properties of the old general class and as a programmer you only require the new features. This helps in a better data analysis, accurate coding and reduces development time. Abstraction - The process of abstraction in Java is used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object (interface). Encapsulation - This is an important programming concept that assists in separating an object's state from its behavior. This helps in hiding an object's data describing its state from any further modification by external component. In Java there are four different terms used for hiding data constructs and these are public, private, protected and package. As we know an object can associated with data with predefined classes and in any application an object can know about the data it needs to know about. So any unnecessary data are not required by an object can be hidden by this process. It can also be termed as information hiding that prohibits outsiders in seeing the inside of an object in which abstraction is implemented. Polymorphism - It describes the ability of the object in belonging to different types with specific behavior of each type. So by using this, one object can be treated like another and in this way it can create and define multiple level of interface. Here the programmers need not have to know the exact type of object in advance and this is being implemented at runtime. insert and delete operations in single linked list

void insert(int p,int v) { node ptr=first,temp;

for(int i=1;i<=p-1;i++) ptr=ptr.next;

temp=new node(); temp.x=v;

temp.next=ptr.next; ptr.next=temp; } void del(int p) { node ptr=first,temp;

for(int i=1;i<=p-1;i++) ptr=ptr.next;

temp=ptr.next; ptr.next=ptr.next.next; temp=null; }


Write functions Insert and Remove which add and remove nodes from ordered single linked list based on the Node value

Operations of insertion and deletion in linked list require simple pointer change, so modifying recursive list traversal we can write a solution as following: Insert:

public Node Insert(Node head, int value) { if (head == null || value < head.value) return new Node(value, head); else { head.next = Insert(head.next, value); return head; } }

Delete:

public Node Remove(Node head, int value) { if (head == null) return null; else if (head.value == value) return head.next; else { head.next = Remove(head.next, value); return head; } }

priority queues The PriorityQueue class implements the Queue interface. When items are added to a PriorityQueue they are not order by First In, First Out . Instead, all items in a PriorityQueue must be comparable (either by implement the Comparable interface or by according to a Comparator) which is used to sort the items in the list. How to declare and initialize a PriorityQueue The example below shows you how to create a PriorityQueue of Strings. Since String implements Comparable, the Strings will be sorted by the compareTo() methods of the Strings in the Queue. A quick refresh on how compareTo() works for Strings: System.out.println("a".compareTo("ab")); prints out -1. Note: The PriorityQueue adds and removes based on Comparable; however, if you iterate of the PriorityQueue you may not get the results that you expect. The iterator does not necessarilly go through the elements in the order of their Priority. In other words, if you want to see how the elements are added and removed, do not rely on an iterator. Use the remove() method of the priorityQueue class as is shown in the example code below. Priority Queue Demo import java.util.*; public class PriorityQueueDemo { PriorityQueue<String> stringQueue;

public static void main(String[] args){

stringQueue = new PriorityQueue<String>(); stringQueue.add("ab"); stringQueue.add("abcd"); stringQueue.add("abc"); stringQueue.add("a"); //don't use iterator which may or may not //show the PriorityQueue's order while(stringQueue.size() > 0) System.out.println(stringQueue.remove()); } }

Output a ab abc abcd Advanced Placement Computer Science students should be understand the five methods below vis a vis a PriorityQueue. boolean add(Object e) Object remove() Object peek() boolean isEmpty()

breadth first search public void breadthfirst() { intBSTNode p=root; Queue queue=new Queue; if(p!=null) { queue.enqueue(p); while(!queue.isempty()) { p=(IntBSTNode)queue.dequeue(); visit(p); if(p.left!=null) queue.enqueue(p.left); if(p.right!=null) queue.enqueue(p.right); } } } depth first search protected void preorder(IntBSTNode p) { if(p!=null) { visit(p); preorder(p.left); preorder(p.right); } } protected void inorder(IntBSTNode p) { if(p!=null) { inorder(p.left); visit(p); inorder(p.right); } } protected void postorder(IntBSTNode p) { if(p!=null) { postorder(p.left); postorder(p.right); visit(p); } }

Linked List a linked list is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a datum and a reference(in other words, a link) to the next node in the sequence; more complex variants add additional links. This structure allows for efficient insertion or removal of elements from any position in the sequence.

A linked list whose nodes contain two fields: an integer value and a link to the next node. The last node is linked to a terminator used to signify the end of the list.
Linked lists are among the simplest and most common data structures. They can be used to implement several other common abstract data types, including stacks, queues, associative arrays, andsymbolic expressions, though it is not uncommon to implement the other data structures directly without using a list as the basis of implementation. Singly linked lists contain nodes which have a data field as well as a next field, which points to the next node in the linked list.

A singly linked list whose nodes contain two fields: an integer value and a link to the next node

Singly linked lists


Our node data structure will have two fields. We also keep a variable firstNode which always points to the first node in the list, or is null for an empty list.

record Node { data; // The data being stored in the node Node next // A reference to the next node, null for last node } record List { Node firstNode // points to first node of list; null for empty list }

Traversal of a singly linked list is simple, beginning at the first node and following each next link until we come to the end:

node := list.firstNode while node not null (do something with node.data) node := node.next

The following code inserts a node after an existing node in a singly linked list. The diagram shows how it works. Inserting a node before an existing one cannot be done directly; instead, one must keep track of the previous node and insert a node after it.

function insertAfter(Node node, Node newNode) // insert newNode after node newNode.next := node.next node.next := newNode

Inserting at the beginning of the list requires a separate function. This requires updating firstNode.

function insertBeginning(List list, Node newNode) // insert node before current first node newNode.next := list.firstNode

list.firstNode := newNode

Similarly, we have functions for removing the node after a given node, and for removing a node from the beginning of the list. The diagram demonstrates the former. To find and remove a particular node, one must again keep track of the previous element.

function removeAfter(node node) // remove node past this one obsoleteNode := node.next node.next := node.next.next destroy obsoleteNode function removeBeginning(List list) // remove first node obsoleteNode := list.firstNode list.firstNode := list.firstNode.next // point past deleted node destroy obsoleteNode

Vous aimerez peut-être aussi