type your search

Wednesday, January 11, 2012

Stacks,Queues and Linked lists

1)Explain how to implement two stacks in one array A[1,...,n] in such a way that neither stack overflows unless the total number of elements in both stacks together is n. The run time of PUSH and POP is O(1).

2)Explain how to implement a queue using two stacks. Analyse the running time of the queue operations.

3)Explain how to implement a stack using two queues. Analyse the running time of the stack operations.

4)Write four O(1)-time procedures to insert elements into and delete elements from both ends of a deque constructed from an array.

5)Implement a stack using a singly linked list L. The run time of PUSH and POP should be O(1).

6)Implement a queue using a singly linked list L. The run time of ENQUEUE and DEQUE should be O(1).

7)Can the dynamic-set operation INSERT be implemented on a singly linked list in O(1) time? What about DELETE?

8)Implement the dictionary operations INSERT,DELETE and SEARCH using singly linked,circular lists.What are the running times of the procedures?

9)Give a THETA(n)-time nonrecursive procedure that reverses a singly linked list of n elements. The procedure should use no more than constant storage beyond that needed for the list itself.

10)Write the operations of INSERT, DELETE and SEARCH in a linked list.Also, how do we reverse a linked list?

5 comments:

  1. 3. Hi Bru,


    Such vivid info on the #topic! Flabbergasted! Thank you for making the read a smooth sail!




    The Make Public function in S3 is perfectly working these past few months and years I should say.
    Just last week, we are experiencing failure in the "Make Public" function. Once I successfully upload a folder (with multiple files) then Make Public the uploaded files, the notification below shows Failure

    Anyways great write up, your efforts are much appreciated.


    MuchasGracias,

    ReplyDelete
  2. Sain Bainuu,



    Your writing shines like gold! There is no room for gibberish here clearly. You nailed it in Stacks,Queues and Linked lists !



    I will have the mp3 files my customer buys on a wordpress page and a cart will direct them to that page. If I want the mp3 files to be downloaded by the customer is there any reason to protect them except to keep them from being indexed by a search engine? Do I need to have a key or do a get operation other than have server-side encryption in S3?


    Very useful article, if I run into challenges along the way, I will share them here.


    Grazie,
    Morgan

    ReplyDelete
  3. Howdy Mate,


    Stacks,Queues and Linked lists being contrived to exist for many projects simply so it can be run will be the first to hit the wall, but those projects where the functions to make existing transactions cheaper in real world applications will find the elusive real world demand.

    I recently attended the AWS Summit London 2018. During the afternoon session about "Open Source at AWS" there were some resources mentioned for persuading your company that open source can be a great benefit to them.
    Unfortunately this wasn't one of the slide sets which has been made available after the event.

    I started using this AWS Training blog for my training practice.


    Follow my new blog if you interested in just tag along me in any social media platforms!


    Cheers,
    Morgan

    ReplyDelete
  4. Hello Mate,

    Your writing shines like gold! There is no room for gibberish here clearly. You nailed it in Stacks,Queues and Linked lists !



    I will have the mp3 files my customer buys on a wordpress page and a cart will direct them to that page. If I want the mp3 files to be downloaded by the customer is there any reason to protect them except to keep them from being indexed by a search engine? Do I need to have a key or do a get operation other than have server-side encryption in S3?

    I started using this AWS Training blog for my training practice.
    Very useful article, if I run into challenges along the way, I will share them here.


    Obrigado,
    Morgan lee

    ReplyDelete
  5. Hello Mate,

    Your writing shines like gold! There is no room for gibberish here clearly. You nailed it in Stacks,Queues and Linked lists !



    I will have the mp3 files my customer buys on a wordpress page and a cart will direct them to that page. If I want the mp3 files to be downloaded by the customer is there any reason to protect them except to keep them from being indexed by a search engine? Do I need to have a key or do a get operation other than have server-side encryption in S3?


    Very useful article, if I run into challenges along the way, I will share them here.


    Obrigado,
    Morgan lee

    ReplyDelete