zoukankan      html  css  js  c++  java
  • Union Two Lists

    class Data_structure
        
    {
            
    public static void Main()
            
    {
                
    int []la={3,5,8,11};
                
    int []lb={2,6,8,9,11,15,20};
                
    int []lc=new int[11];
                
    int i=0,j=0,k=0;
            
    while(i<la.Length && j<lb.Length)
                
    {
                    
    if(la[i]<=lb[j])
                    
    {
                        lc[k
    ++]=la[i++];
                    }

                    
    else
                    
    {
                        lc[k
    ++]=lb[j++];
                    }
                    
                }

                
    while(i<la.Length)
                
    {
                    lc[k
    ++]=la[i++];
                }

                
    while(j<lb.Length)
                
    {
                    lc[k
    ++]=lb[j++];
                }
      
                
    foreach(int element in lc)
                    Console.Write(element
    +"\t");
                Console.Read();
            }

        }
  • 相关阅读:
    Android 动画-alpha(渐变透明度动画效果)
    Memento(备忘录)
    Mediator(中介者)
    Iterator(迭代器)
    Command(命令)
    Chain of Responsibility(责任链)
    Template Method(模板方法)
    Interpreter(解释器)
    Proxy(代理)
    Flyweight(享元)
  • 原文地址:https://www.cnblogs.com/gmq/p/513182.html
Copyright © 2011-2022 走看看