Posts

Showing posts from 2016

Useful SQL commands

Useful  SQL commands Here I used Table Name as " TechConnect " for all Query. 1. To Create Table:- > Create Table TechConnect    (Name Varchar2(30), College_name Varchar2(30), Roll_no Number(15), D.O.B Date, Height      Number(4,2)); 2. To Insert Data Into Table:-   > Insert into  TechConnect     Values('Ram Kumar',  'ABCDE', 123001, '11-Jan-1994', 7.5); 3. To see items of table:-   > Desc  TechConnect; 4. To show whole data of a Table:-   > Select * from  TechConnect; 5. To select any Column     > Select Name, College_name, D.O.B from  TechConnect; 6. To save :-       > Commit: 7. To Delete From Table (Row / Tuple):-      > Delete from  TechConnect where name = 'Ram Kumar'; 8. To Add extra Column in exist Table :-   > Alter table  TechConnect add (Dept Varc...

Bubble Sorting In c Language

Keep In Mind:- 1. If there are N number of unsorted elements then N-1 number of iteration. 2. Start comparison from left to right. 3. Do comparison only with adjacent  elements (left to right). 4. T(n) = O(n2)    (worst case) 5. Best case : O(n) 6. Average case : O(n2). Basic Idea:- Given elements in an array: - 2,4,1,5,3,7 . Step 1- Choose 2 and compare with 4  =  2,4  (2<4 no swapping).                    "     4   "        "           "     1=   2,1,4  (4>1  swaping done)                     "     4   "         "         "     5=   2,1,4,5  (4<5  no swapping)                     "      5   "   ...

Insertion Sorting in C Language.

Keep in mind:- 1. Take one element at a time for sorting (i.e. one by one). 2.  Useful for sorting small data set (not used this sorting for large data sets). 3. Time complexity is Worst case =O(n2).. 4. Time complexity depend on number of compare + number of movement. 5. Sometime calls as In-Place Algorithm. 6. It may be ascending or descending orders. Basic Idea:- If you have 4 cards (numbering 4,3,7,1).           Before sorting :- 4,3,7,1.            After sorting :-   1,3,4,7. Process:- 1. Take first card (i.e. 4). 2.  Take another card 3 compare with first one, we got 4>3. So move 3 before 4. 3. Take 3rd card 7 compare with previous one 4, we got 7>4. So no need to sorting, 4. Take 4th card 1 compare with previous one 7, we got 1<7. So move one place left, again 1<4 move      left, again 1<3 move left. Therefore 1 comes at their position. Sorting Done. Alg...