All about very small logical and programming problems. Complex theories made simple to understand
Tuesday, September 13, 2011
Generic Java Stack - Work application Question
Question :
package jp.co.worksap.intern;
/**
*The Stack class represents a last-in-first-out(LIFO) stack of objects
*And this class can look at the object which has the highest (lowest or so) value.
*So every object onto the stack must be comparable to each other.
*@param<E.
*/
public interface ISortableStack<E extends Comparable<E>>{
/**
*Pushes an item onto the top of this stack.
*If the Element e is null, throws NullPointerException.
* @param e
*@throws NullPointerException
*/
public void push(E e);
/**
*Removes the object at the top of this stack and returns that object as the value of this function.
*If the stack is empty, throws EmptyStackException.
*@return
*@throws EmptyStackException
*/
public E pop();
/**
*Locks at the object which has the middle value among the all objects without removing it from the stack.
*Returns the object which has the value of following order <code>(size()/2)+1</code>
*<pre>
*e.g. When the stack has the following values (1, 2, 5, 4, 2, 6)
*this method returns 4 and doesn't remove the object.
*</pre>
*If the stack is empty, throws EmptyStackException.
*@return
*@throws EmptyStackException
*/
public E peekMidElement();
/**
*Looks at the object which has the highest value among the all objects without removing it from the stack.
*Returns the object which has the value of the following order <code>size()</code>
*<pre>
*e.g. When the stack has the following values (1,2,5,4,2,6)
*this method returns 6 and doesn't remove that object
*</pre>
*If the stack is empty, throws EmptyStackException.
*@return
*@throws EmptyStackException
*/
public E peekHighestElement();
/**
*Looks at the object which has the lowest value among the all objects without removing it from the stack.
*Returns the object which has the value of the following order <code>1</code>
*<pre>
*e.g. When the stack has the following values (1,2,5,4,2,6)
*this method returns 1 and doesn't remove the object.
*</pre>
*If the stack is empty, throws EmptyStackException.
*@return
*@throws EmptyStackException
*/
public E peekLowestElement();
/**
*Returns the number of objects in this stack.
*@return
*/
public int size();
Answer :
Mediafire Links:
Method 1
Method 2
Monday, September 12, 2011
Types of tables in oracle
There are seven types of tables:
CREATE TABLE t1 (c1 NUMBER PRIMARY KEY, c2 VARCHAR2(30)) organization heap;
1. Heap organized tables:
A heap-organized table is a table with rows stored in no particular order. This is a standard Oracle table; the term "heap" is used to differentiate it from an index-organized table or external table.If a row is moved within a heap-organized table, the row's ROWID will also change.
Ex.CREATE TABLE t1 (c1 NUMBER PRIMARY KEY, c2 VARCHAR2(30)) organization heap;
2.Index organized tables:
Index Organized Tables are tables that, unlike heap tables, are organized like B*Tree indexes. Besides storing the primary key values of an Oracle indexed-organized tables row, each index entry in the B-tree also stores the non-key column values.Index clustered tables
Hash clustered tables
Nested tables
Global temporary tables
Object tables
Apriori Algorithm and It's improvement
Encapsulation in Detail
What is Encapsulation:
Standard definitions says that it a process of wrapping up of data members and methods inside a class with the help of some access specifiers..
private,public and protected.
Private is a type of an access specifier which can be applied to a class, data member,method.
If given to a class then the data members,methods in that class can only access the class which is given as private.
public is type of an access specifier which can again be applied to a class, data members, methods and can be accessed from anywhere in the program.
protected is an other type of access specifier which can again be applied to a class,data members and methods and only the derived classes of that base class can be accessed to the base class which is protected.
Standard definitions says that it a process of wrapping up of data members and methods inside a class with the help of some access specifiers..
private,public and protected.
Private is a type of an access specifier which can be applied to a class, data member,method.
If given to a class then the data members,methods in that class can only access the class which is given as private.
public is type of an access specifier which can again be applied to a class, data members, methods and can be accessed from anywhere in the program.
protected is an other type of access specifier which can again be applied to a class,data members and methods and only the derived classes of that base class can be accessed to the base class which is protected.
Solid Nutrition ,Education & Health for 40 poor kids at Chinchwad ,Pune-33
Solid Nutrition ,Education & Health for 40 poor kids at Chinchwad ,Pune-33: 15000 kids (2-6 years age) from the poor families are suffering from malnutrition and poor hygiene in chinchwad,Pune-33They dont get convent education , good nutritional diet and proper care.For this govt is also trying but could not get success in last so many decades.Our aim is to provide toppings to them so that we can prepare them for the future.One healthy n good educated girl can change the generation,society n the nation.
Subscribe to:
Posts (Atom)