Posts

Life cycle of Servlet

Image
Life cycle of Servlet :- The life cycle of a servlet can be categorized into four parts: 1.      Loading and Inatantiation:  The servlet container loads the servlet during startup or when the first request is made. The loading of the servlet depends on the attribute of web.xml file. If the attribute has a positive value then the servlet is load with loading of the container otherwise it load when the first request comes for service. After loading of the servlet, the container creates the instances of the servlet.

Write a menu driven program to perform insert and delete operations in a circular linked list

#include #include #include #include #include int insbeg(int item); int inspos(int item); int insend(int item); int length(); int delbeg(); int delpos(); int delend(); struct node {             int info;             struct node *link; }; typedef struct node n1; n1 *last = NULL; n1 *currptr, *newnode, *preptr;

Write a program to add two polynomials using a linked list

#include #include #include struct poly_node {             int coeff, expo;             struct poly_node *link; }; typedef struct poly_node poly; poly *insert_polynode(int, int, poly*);

Depth first search (DFS)

This is a very simple type of brute force searching techniques. The search begins by expanding the initial node i.e. by using an operator generate all successors of the initial node and test them. This procedure finds whether the goal can be reached or not but the path it has to follow has not been mentioned. Diving downward into a tree as quickly as possible performs DFS searches. Algorithm:

Breadth First Search (BFS)

This is also a brute force search procedure like DFS. We are searching progresses level by level. Unlike DFS which goes deep into the tree. An operator employed to generate all possible children of a node. BFS being a brute force search generates all the nodes for identifying the goal. ALGORITHM:

Write a short note on Best first search ?

Best-first search, rather than plunging as deep as possible into the tree (as in   depth-first search ), or traversing each level of the tree in succession (as in   breadth-first search ), uses a heuristic to decide at each stage which is the best place to continue the search. Best-first search in its most basic form consists of the following algorithm (adapted from   Pearl, 1984): The first step is to define the OPEN list with a single node, the starting node. The second step is to check whether or not OPEN is empty. If it is empty, then the algorithm returns failure and exits. The third step is to remove the node with the best score, n, from OPEN and place it in CLOSED. The fourth step “expands” the node n, where expansion is the identification of successor nodes of n. The fifth step then checks each of the successor nodes to see whether of not one of them is the goal node. If any successor is the goal node, the algorithm returns success and the solution, which c...
Hiiiii to all........pls frnds....before download the content from this blog...plss join this site and like my facebook page also ......  http://www.facebook.com/Prasenrajblog.......thanks to all......