Monday, February 25, 2019

Insert node in red black tree

Insert The Node In Red Black Tree

properties:

~Insert

 Node must be red.

~Arranged the color according to the Red Black Tree.

Root is always black

Every leaf  which nil (null) is black.

If node is red then both children must be black or if node is red, then its parent must be black.

~Rotation 

  According to the cases.

  There are case in given below.

~ Violation of properties of red black tree.

Case :

case 1. After insert.(New Node uncle is red).

1.Change the color of grandparent of new node. 
   2.Change the color of parent and uncle of new node.  

~ New node unle is black and New node is right child of the parent.
  

Follow this :
1. Anti-clock wise Rotation of the grandparent of the new node.
~ New Node uncle is black and new node is left child of it's parent .



 Follow this : 
1.Clockwise rotation of the grandparent of new node.
2. Exchange color of the grandparent and parent of new node.

Saturday, February 23, 2019

Bubble Sort(python)

SORTING

Sorting is a process to arranged the data in some type of order.
This is order may increasing, decreasing and numerical value or dictionary
in case of alphanumerical values.
Bubble Sort.
Bubble sort is very simple and easy to implement the sorting technique
Algorithm 
Bubblesort(a,n)

Here a is a linear array of n element
Step
1. Repeat step 2 and 3 for i= 1 to n-1.
2. Set j=1 [ Intilize counter ].
3. Repeat Step While(j>n-1)

     $). if a[i] > a[i+1] then 
         interchange  a[i] and  a[i+1]
         End if structure. 
     $). j= j+1.
    End of inner loop.
 End of step 1 outer loop.
 4.Exit

Program to write the Bubble sort..

def bubbleSort(a):

n = len(a) for i in range(n): for j in range(0, n - i - 1): if a[j] > a[j + 1]: temp=a[j] a[j] = a[j+1] a[j+1]=temp # Or we can a[j], a[j + 1] = a[j + 1], a[j] # before sorted array. a = [4, 3, 5, 1, 2, 11, 20,45,22,63] # function for bubble sort. bubbleSort(a) print("After Sorted array is:") # b indicate the size of the array. b = len(a) for i in range(b): print(a[i],end=" ")

Red black tree(Introduction)

Vikas Tomar's DEV Profile

Red black tree (Introduction)

Red black tree is special type of binary search tree. It is self balancing binary search tree like as (AVL tree).
Some properties must be follow for red black tree.
Properties:
  • Every node has a color either Black and red.
  • Root node always a black.
  • Every leaf  which nil (null) is black.
  • If node is red then both children must be black or if node is red, then its parent must be black.
  • for n node, all path form the to descendant leaves contain the same number of black node




              




NOTE ⇉  Whenever root is red node then we remove node by black node.

 



Thursday, December 27, 2018

Internships in India for College Students

Internships in India for College Students
1.  http://www.twenty19.com/internships/
 Purpose:

  • Twenty19 is an student opportunity portal

 30 lakh+ college student trust twenty19..

 Twenty19 strives to educate and enable students to learn by doing.it's so useful for educated person.
2. https://internshala.com/


InternshalaInternshala is an internship and online training platform, based out of Gurgaon, India. Founded by Sarvesh Agrawal, an IIT Madras alumnus, in 2010, the website helps students find internships with organisations in India.



InternshalaInternshala Student Partner 11 (ISP) is India's largest studentcommunity. ... During this program, you will learn to lead from the front and develop essential skills like marketing and communication while you represent Internshalain your college and understand how it all comes together for a cause

Million+ of student on this website are apply national and multinational company for internship.
 

Join India’s largest student community







Pattern(python 2.7.15)

SOME IMPORTANT PATTERN IN PYTHON 2.7.15 PROGRAMMING LANGUAGE














Question 1.                                                                                                     OUTPUT:                                                               
                                                                                                  
n=input("enter any number")
for i in range(n):                                                        
    print("*")*i                                                            
print("*")*(i+1)                                                            
for i in range(n,0,-1):                                                 
    print("*")*i                                                 





Question 2..
  
n=int(input("enter the number"))
print("\n")
for i in range(0,n):
    print("  ")*i,
    for j in range(n,i,-1):
        print("*"),
    print

enter the number6

     * * * * * *
        * * * * *
           * * * *
              * * *
                 * *
                    *

Friday, December 7, 2018

RIGHT THING.

                     DO THE RIGHT THING. 

 The most original thing of every person is  do the right  thing .
yeah 
it's a most difficult task of everyone .


We always know 
it's the right thing,
when in the end 
there is peace.

Everybody know that  " right thing "  is  peacefull . 
but 
the  truth is that this path may be difficult for some person
or 
may be not .

 ~ last but not least 
but we can try to go this path 
for few minute , hour , day , week, year or whole life .




Monday, November 26, 2018

Introduction of python

Vikas Tomar's DEV Profile

 

Guido van Rossum (born 31 January 1956) is a dutch programmer best know for the author the python programming language. Nowsday he is working in dropbox company.













 

About python



~ python is a object  oriented , high level , open source , interpreter based programming language . It is very simple , easy to use .



feature of python :

  1. Interpreter based 
  2. graphic user interface( GUI)
  3. case sensitive language
  4. object oriented based
  5. east to understand
  6. open source
  7. large standard library
  8. platform independent

Arrays in Solidity Programming Language.

Arrays Solidity supports both generic and byte arrays. It supports both fixed size and dynamic arrays. It also supports multidimensional ...