Puzzle
From: Siddharth Taneja (siddharth.taneja_at_gmail.com)
Date: 11/06/04
- Next message: Ben Pfaff: "Re: Puzzle"
- Previous message: hari4063: "Re: Giving the preorder & inorder lists, How can be constructed the"
- Next in thread: Ben Pfaff: "Re: Puzzle"
- Reply: Ben Pfaff: "Re: Puzzle"
- Reply: Karthik Kumar: "Re: Puzzle"
- Reply: CBFalconer: "Re: Puzzle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Nov 2004 18:33:58 -0800
Heres one I heard-
For an array of integers in sorted order, which can have multiple
occurences of any integer, form an array which lists the integers just
once first, and then their duplicates in sorted order.
Thus for
1 1 1 2 2 3 9 9 9 10
the o/p should be
1 2 3 9 10 1 1 2 9 9
The algorithm should be O(n) in running time...and should use only
O(1) extra space.
Siddharth Taneja
- Next message: Ben Pfaff: "Re: Puzzle"
- Previous message: hari4063: "Re: Giving the preorder & inorder lists, How can be constructed the"
- Next in thread: Ben Pfaff: "Re: Puzzle"
- Reply: Ben Pfaff: "Re: Puzzle"
- Reply: Karthik Kumar: "Re: Puzzle"
- Reply: CBFalconer: "Re: Puzzle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|