Thread: Data Structure exam help

  1. #1
    Registered User
    Join Date
    Sep 2003

    Data Structure exam help

    Here are a few questions I'm trying to figure out. I have an exam for my Data Structure class soon. These are selected sample exam questions which I'm having a little troubling figuring out. Can anyone help?

    1a) Explain how to implement a stack using linked list or array?
    How would I implement it using a linked list? Can someone explain this? I'm not looking for the code, but explaination. Example: what accessors/methods do I need? What private/public parts in a class do I need? The same goes for array?

    1b) What is the cost of the stack operations in space(memory) and time(CPU) for this implementation?

    1c) If I were to implement a binary tree using array or linked list, which would be more efficient? Advantages/disadvantages?

    2) Given a in-fix expression: 8-7*(6-5/4)-3, how would I put it in pre-fix and post-fix expression?

    3) Can someone explain to me why the average depth of a BST is O(log N)?


  2. #2
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Have you ever considered opening your book?

    All the data structures books I have looked at answer most of your questions. If the book is too intimidating, try google or search on this board. Then combac with whatever else you don't understand.

    some entropy with that sink?

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. static data structure in a library
    By melight in forum C Programming
    Replies: 6
    Last Post: 01-10-2009, 11:12 AM
  2. Data structure implementation
    By fkheng in forum C Programming
    Replies: 3
    Last Post: 07-31-2003, 07:44 AM
  3. can't insert data into my B-Tree class structure
    By daluu in forum C++ Programming
    Replies: 0
    Last Post: 12-05-2002, 06:03 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Dynamic Data Structure -- Which one is better?
    By Yin in forum C++ Programming
    Replies: 0
    Last Post: 04-10-2002, 11:38 PM