首页 

 论坛 
 

 相关链接
  中兴和华为的面试经历
  什么是打工,什么是创业-I
  微软面试题总结版-上海
  微软面试题总结版-北京
  华为新员工转正笔试题(附答
  盛大的荣誉
  IBM的招聘经
  雅虎笔试题
  yahoo面试之笔试题
  诺基亚笔试题目
  雅虎公司C#笔试题
  [惠普]HP公司目标的陈述
  联想靠文化解决:不同背景、
  联想CFO诠释诚信
  把珍珠串成项链——联想集团
  联想的用人观
  从联想分拆看中国企业管理官
  联想人亲身感触2004联想
  联想CKO张后启的知识管理
  联想副总裁汉普管理咨询总裁
  论坛热贴
  文章查询
 
  内容:
 
  类别:

           
   
文章目录:返回首页--IT行业--SAP笔试题

SAP笔试题

 
    1.Below is usual way we find one element in an array:
    const int *find1(const int* array, int n, int x)
    {
    const int* p = array;
    for(int i = 0; i n; i++)
    {
    if(*p == x)
    {
    return p;
    }
    ++p;
    }
    return 0;
    }
    In this case we have to bear the knowledge of value type "int", the size of
    array,
    even the existence of an array. Would you re-write it using template to elim
    inate all
    these dependencies?
    2. Assume you have a class like
    class erp
    {
    HR* m_hr;
    FI* m_fi;
    public:
    erp()
    {
    m_hr = new HR();
    m_fi = new FI();
    }
    ~erp()
    {
    }
    };
    if "new FI()" failed in the constructor, how can you detect this problem and
    release the
    properly allocated member pointer m_hr?
    3. Check the class and variable definition below:
    #include
    #include
    using namespace std;
    class Base
    {
    public:
    Base() { cout"Base-ctor"endl; }
    ~Base() { cout"Base-dtor"endl; }
    virtual void f(int) { cout"Base::f(int)"endl; }
    virtual void f(double) {cout"Base::f(double)"endl; }
    virtual void g(int i = 10) {cout"Base::g()"iendl; }
    };
    class Derived: public Base
    {
    public:
    Derived() { cout"Derived-ctor"endl; }
    ~Derived() { cout"Derived-dtor"endl; }
    void f(complex) { cout"Derived::f(complex)"endl; }
    virtual void g(int i = 20) {cout"Derived::g()"iendl; }
    };
    Base b;
    Derived d;
    Base* pb = new Derived;
    Select the correct one from the four choices:
    Coutsizeof(Base)endl;
    A. 4 B.32 C.20 D.Platform-dependent
    Coutsizeof(Base)f(1.0);
    A.Derived::f(complex) B.Base::f(double)
    pb->g();
    A.Base::g() 10 B.Base::g() 20
    C.Derived::g() 10 D.Derived::g() 20
    4.Implement the simplest singleton pattern(initialize if if necessary).
    5.Name three sort algorithms you are familiar with. Write out the correct or
    der by the
    average time complexity.
    6.Write code to sort a duplex direction linklist. The node T has overridden
    the comparision operators
 
Email: webmaster@minicareer.com
Copyright 2005-2006 Minicareer. All Rights Reserved.