Language Bar

Wednesday, December 12, 2012

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures


MIDTERM EXAMINATION
Spring 2010
CS301- Data Structures

Question No: 1      ( Marks: 1 ) - Please choose one
A queue where the de-queue operation depends not on FIFO, is called a priority queue

False
True         (Page 101)

Question No: 2      ( Marks: 1 ) - Please choose one
The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should

►  Use better data structures
Increase the hard disk space    (Page 5)
Use the better algorithm
►  Use as much data as we can store on the hard disk

Question No: 3      ( Marks: 1 ) - Please choose one
Consider the function X as under
int X (int& Value)
{
return Value;
}
Now a and b are integers in a calling function. Which one of the following is a valid call to the above function
X.
a = X (b) ;
► a = X (&b) ;
a = X (*b) ;
None of the given options
Here function argument passing by reference method is used, so when we call a function we will give the variable reference as parameter.

Question No: 4      ( Marks: 1 ) - Please choose one
In the call by value methodology, a copy of the object is passed to the called function.

False
► True      (Page 202)
Question No: 5      ( Marks: 1 ) - Please choose one
The tree data structure is a
Linear data structure
► Non-linear data structure      (Page 112)
Graphical data structure
Data structure like queue

Question No: 6      ( Marks: 1 ) - Please choose one
When should you use a const reference parameter?

Whenever the parameter has huge size.
► Whenever the parameter has huge size, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument.
Whenever the parameter has huge size, the function changes the parameter within its body, and you DO
want these changes to alter the actual argument.
Whenever the parameter has huge size, and the function does not change the parameter within its body.

Declaring a parameter as a const simply means that the function can’t change the value of its parameters.

Question No: 7      ( Marks: 1 ) - Please choose one
Here is the start of a C++ class declaration:
class foo
{
public:
void x(foo f);
void y(const foo f);
void z(foo f) const;
...
Which of the three member functions can alter the PRIVATE member variables of the foo object that activates the function?
Only x can alter the private member variables of the object that activates the function.
Only y can alter the private member variables of the object that activates the function.
Only z can alter the private member variables of the object that activates the function.
► Two of the functions can alter the private member variables of the object that activates the
function.

Only the x and y can alter the private member variable of the foo class object. Last Option is more correct but not exact. In the last option the two function name are not mentioned

Question No: 8      ( Marks: 1 ) - Please choose one
What is the maximum depth of recursive calls a function may make?

1
2
n (where n is the argument)
► There is no fixed maximum

Question No: 9      ( Marks: 1 ) - Please choose one
Suppose n is the number of nodes in a complete Binary Tree then maximum steps required for a search
operation are,
► Log2 (n+1) -1           (Page 139)
Log2 (n+1)
Log2 (n) – 1
Log2 (n)

Question No: 10      ( Marks: 1 ) - Please choose one
In the linked list implementation of the stack class, where does the push member function places the new entry
on the linked list?

► At the head       (Page 53)
At the tail
After all other entries that are greater than the new entry.
After all other entries that are smaller than the new entry.

Question No: 11      ( Marks: 1 ) - Please choose one
Suppose we have a circular array implementation of the queue class, with ten items in the queue stored at
data[2] through data[11]. The CAPACITY is 42, i.e., the array has been declared to be of size 42. Where does the push member function place the new entry in the array?

data[1]
data[2]
data[11]
data[12]

Question No: 12      ( Marks: 1 ) - Please choose one
The expression AB+C* is called?

Prefix expression
Postfix expression       (Page 70)
Infix expression
None of these

Question No: 13      ( Marks: 1 ) - Please choose one
is a binary tree where every node has a value, every node's left subtree contains only values less
than or equal to the node's value, and every node's right subtree contains only values that are greater then or equal?

Strictly Binary Tree
► Binary Search tree          Click here for detail
AVL tree
All of these

Question No: 14      ( Marks: 1 ) - Please choose one
Consider the following binary search tree (BST):


If node A in the BST is deleted, which two nodes are the candidates to take its place?



Question No: 15      ( Marks: 1 ) - Please choose one
Lets call the node as that requires re-balancing. Consider the two cases given below:
1) An insertion into left sub tree of the left child of a
2) An insertion into right sub tree of the right child of a.
Which of the following statement is correct about these two cases?
1) The insertion occurs outside (i.e., left-left or right-right) in cases 1 and 2 single rotation can fix the balance in these two cases.
2) The insertion occurs inside ((i.e., left-left or right-right) in cases 1 and 2. single rotation cannot fix the balance in these two cases

Question No: 16      ( Marks: 1 ) - Please choose one
We access elements in AVL Tree in,

Linear way only
► Non Linear way only
Both linear and non linear ways
None of the given options.

Question No: 17      ( Marks: 2 )
AVL Tree is,

► Non Linear data structure           Click here for detail
Linear data structure
Hybrid data structure (Mixture of Linear and Non Linear)
None of the given options.


10 comments:

  1. Generally speaking, there are several main techniques made
    use of by data mining software: clustering, distinction, regression and association approaches.

    This running water will in fact speed up your removal of the water and with a simple flip of the valve can add water
    to the fish tank. Thanks for reading this article about Oregon gem
    mining on Associatedcontent.

    ReplyDelete
  2. Deciding to buy online can result in a huge cost savings while providing you the
    best options for your hair care needs today.

    As natural products don't have any side-effects, you can rest assured for healthy hair. Both brands are popular in known hair salons and spas.

    Feel free to visit my web-site :: hair products

    ReplyDelete
  3. If you are like me and love garlic, you are already too late.
    So, I propose to you that you might want to consider doing your own
    organic gardening right in your own back yard.
    This will give them time to acclimate to their new environment, avoiding stress and shock often associated with
    transplanting, ensuring a healthy start.

    Feel free to visit my web-site olden

    ReplyDelete
  4. There are a few types, mainly fine, regular, or rough. Identify
    your own hair trouble and go for a product which mainly addresses your needs.
    It only leaves a lustrous sheath on the hair and gives it
    a beautiful look rather and the greasy effect that is left by the usual hair oils.
    Your health and appearance can be improved with essential oils.
    Basil and bergamot help your hair grow thicker and fuller.


    Feel free to surf to my page ... how to grow hair faster

    ReplyDelete
  5. If there's give in the stakes or the form, neither of them are doing their jobs correctly. concrete finishing is very much like smoothing out frosting on a birthday cake. Read your warranty carefully, and you'll see that
    it probably doesn't cover walls with efflorescence.

    ReplyDelete
  6. Therefore, if you wanted to specifically look for CNN News, it is
    right there in its own directory on the front webpage. E-papers
    are able to take advantage of story, sacrificing other, decidedly
    less important stories and giving as much detail about breaking news as
    possible. Current newspapers provide different articles in the development
    of the nation. Some say it would have, because there is an ongoing collaboration between the
    two groups in attacks on Israel. But I felt I had something interesting,
    if not unique, to say about the Mafia because as a
    boy I had listened not only to Mafiosi in my stepfather's kitchen but to first and second generation Sicilians who understood how and why the Mafia had gotten a foothold in this country.

    Also visit my web blog; click here

    ReplyDelete
  7. Make sure you only use clean balls for playing on indoor simulator.
    All of these issues add to the interest that can
    be produced about a site and this works for spots in this place and any place in the world.

    However, such training programs are tough to wave through since it require tons of
    learning patience and willingness to proven
    one’s innate skills. If you are using your own clubs, clean it
    with a wet cloth at least every 2-3 days. If you want to manage your own virtual airline then
    you need to visit the main Sim - Miles website and complete a
    virtual airline application form.

    ReplyDelete
  8. I love your blog.. very nice colors & theme. Did
    you make this website yourself or did you hire someone to do it for
    you? Plz answer back as I'm looking to construct my own blog and would like to find out where u got this from. thanks a lot

    Here is my blog post - fat loss factor

    ReplyDelete
  9. It is indeed possible to lower high blood pressure by only taking herbal medicines and vitamins and
    eating certain foods that can lower high blood pressure.
    An image will help flesh out exactly what you’re trying to announce while adding character,
    flavor and visual appeal to the document. A good personal injury lawyer can
    save you from making a great deal of mistakes and can shoulder much of the hassle of
    knowing what to do about car repairs, car rentals, medical treatment,
    witness statements and the like. Different from other girls,
    she did not wear the very sexy short dress and very high-heeled shoes, she
    only wore a white skirt, which suited her slim figure very much, and her
    hair was very straight, she had white and smooth skin, a pair of
    big eyes which could speak for her, I saw the unique charm in her.
    ’ ”   The final breaking point, she says, was when he said he wanted to move his ex-stripper girlfriend in with them.



    my blog post; nobody'd

    ReplyDelete
  10. As the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.


    Here is my web blog; click here

    ReplyDelete

Amazon

Disqus

comments powered by Disqus

CONTACT US FORM