目前本站已有 十几万 份求职资料啦!


SAP笔试试题

12-17 15:52:25 来源:http://www.qz26.com 笔试题目   阅读:8769
导读: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 ofarray,even the existence of an array. Would you re-write it using template to eliminate allthese dependencies?2. Assume you have a class likeclass erp{HR* m_hr;FI* m_fi;public:erp(){m_h
SAP笔试试题,标签:银行笔试题目,企业笔试题目,http://www.qz26.com

  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"< ~Base() { cout<<"Base-dtor"< virtual void f(int) { cout<<"Base::f(int)"< virtual void f(double) {cout<<"Base::f(double)"< virtual void g(int i = 10) {cout<<"Base::g()"<};

  class Derived: public Base

  {

  public:

  Derived() { cout<<"Derived-ctor"< ~Derived() { cout<<"Derived-dtor"< void f(complex) { cout<<"Derived::f(complex)"< virtual void g(int i = 20) {cout<<"Derived::g()"<};

  Base b;

  Derived d;

  Base* pb = new Derived;

  Select the correct one from the four choices:

  Cout

  Cout

  pb->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


Tag:笔试题目银行笔试题目,企业笔试题目求职笔试面试 - 笔试题目
【字号: 】 【打印】 【关闭
《SAP笔试试题》相关文章
最新更新
推荐热门
联系我们 | 网站地图 | 财务资料 | 范文大全 | 求职简历 | 财会考试 | 成功励志
Copyright 二六求职资料网 All Right Reserved.
1 2 3 4 5 6 7 8 9 10