Guys, why don't we do something like this :
1. If (arrayHasBeenTraversed, Goto 4).
Else, Traverse the 2-D array [row,column] wise. Inspect element
array[row][column]. Goto 2.
2. If you encounter a '1' (array[row][column]),
change all the 0's in the corresponding [row,column] to '-1'
Al
@bharat
take two hashmaps of
hash1 and
hash2
take frequency of a data from hash1, and find its list in hash2.
if ur poping, reduce frequency in hash1 and in corresponding hash2 remove
its entry in that list and put it in freq-1 entry
and keep track of max and second max of highest frequncy value of
Full of Aptitude. they check the speed and accuracy...
With regards,
Praveen Raj
DCE-IT 3rd yr
735993
praveen0...@gmail.com
On Thu, Sep 8, 2011 at 3:33 AM, htross wrote:
> future first is coming to our college.what kind of questions will
> be asked in first round
>
> --
> You
@surender: say the hash table of is as follows...
<1,2->3->4>
<2,5->6>
<3,7->8>
pop(7) would decrease the frequency of element 7 means that element has to
be added to 2nd key i.e <2,5->6->7> here
how do u get the element 7 from hash table as freq is the key element in u'r
table?
And after getting
@praveen raj: yes bubble sort takes O(N) in best case,
but selection sort it depends the selection algo(does the selection
starts from the first(then itsO(n)) or last(then its O(N^2))
Thank you,
Sid.
On Fri, Sep 9, 2011 at 11:20 AM, praveen raj wrote:
> for checking whther given array sorted or
for checking whther given array sorted or not... bubble sort or insertion
sort... takes O(n).. time...
With regards,
Praveen Raj
DCE-IT 3rd yr
735993
praveen0...@gmail.com
On Thu, Sep 8, 2011 at 11:32 PM, aayush jain wrote:
> thanx @piyush
>
> --
> You received this message because y
Go Go Go!!!
On Fri, Sep 9, 2011 at 11:07 AM, Kunal Patil wrote:
> Cool.. If you can share/ask algorithm related programming questions.. :)
> In fact it is the main cause of this group. :) :) :)
> There are sufficient SPOJ problem discussions over here..
> You can continue asking questions if you
maintain a hash of
linked_list consists of values of that frequency.
values with same frequency comes under same list
if pop of a particular value is done, then frequency is changed of that
number, a new record would be created if required.
maintain two values tracking max and second_max, which wo
Cool.. If you can share/ask algorithm related programming questions.. :)
In fact it is the main cause of this group. :) :) :)
There are sufficient SPOJ problem discussions over here..
You can continue asking questions if you think, that particular problem
needs special data handling techniques to m
I am considering..
Maxheapify... A[parent(i)]>=A[i]
kth largest element...
therefore O(klogn)...
k times u have to extract the largest element and logn to maintain the
maxheapify everytime.
minheapifyA[parent(i)]<=A[i]
kth largest element that means ... (n-k) smallest element.
the
Hey, anyone preparing for acm-icpc
what about discussing acm-icpc questions here
what say @shady??
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from t
I suggest you read virtual memory concept one more time(Galvin (OS
priciples))... and of course as you said CPU registers also matters...
RAM extension is mainly depends on processor...whether it is 16 bit or 32 or
64... You check the entry for PHYSICAL ADDRESS EXTENSION in wikipedia.. hope
that w
Through heapsort
k times...
O(klogn)
.
With regards,
Praveen Raj
DCE-IT
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
al
@vishwa : Only addr bus!! or opcode also needed to fit in the register
think of it .. and 2nd quest(RAM limitation)ans?
On Fri, Sep 9, 2011 at 10:06 AM, vishwa wrote:
> It depends on Address Bus... whether its 32bit or 64 bit... its like can
> address bus hold that address.
>
>
> On Fri, Sep
@himansu: how can quicksort selecting kth largest element be done in O(n)
time ...I think in worst case it takes O(n^2) time
will u pls explain this.
On Fri, Sep 9, 2011 at 2:10 AM, Himanshu Neema <
potential.himansh...@gmail.com> wrote:
> @Dave: Thanks for pointing that out .
>
> In
It depends on Address Bus... whether its 32bit or 64 bit... its like can
address bus hold that address.
On Fri, Sep 9, 2011 at 9:40 AM, bharatkumar bagana <
bagana.bharatku...@gmail.com> wrote:
> To access a data element , processor has to have the address of that data
> element .. for that, proc
The questions asked to us was simliar to this (it was titled *The Game of
Life* :D),
Consider a MxN matrix, with each cell painted either black or white. A flip
is defined over a cell as inverting the colors of all cells in the 3x3 grid
centered at that cell. The outermost boundary never changes c
Randomized quick sort .. even the worst case in this algo is O(n^2) also,
this is best sorting algo ..
It is showed that nearly 20-25% of time O.S spends its time in sorting.In
unix based systems , they are using this algo only ..
A random choice will only choose from middle parts half the time. Ho
To access a data element , processor has to have the address of that data
element .. for that, processor should have some register or address bus or
some thing like that to fetch the data ...what is the limitation from
processor side in extending the memory?
and also what is the limitation from pro
Hi,
PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
DUninterruptible sleep (usually IO)
RRunning or runnable (on run queue)
SInterruptible sleep (waiting for an event
output of ps aux command looklike--
USER PID %CPU %MEMVSZ RSS TTY STAT START TIME
COMMAND
x 1433 0.0 0.123940 2548? Sl
05:55 0:00/usr/bin/gnome-
y 1512 0.0 0.294388 4772?
Please reply with your alog...!
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/OGVCUV_hutUJ.
To post to this group, send email to algogeeks@googlegroups.co
#include
#include
#include
#include
#include
using namespace std;
class GraphClass
{
int arr[1000][1000];
int r,c;
public:
GraphClass()
{
for(int i=0;i<1000;i++)
memset(*(arr+i),0,sizeof(*(arr+1)));
r=c=0;
}
void ReadFromFile(char *str)
{
FILE *f;
char buff[1000]={'\0'};
@Dave: Thanks for pointing that out .
In that case , if tree is really big and we want to *save memory* :
*Algorithm #1 :*
1) Convert tree to a linked list ( Right rotation or left rotation ) : O(n)
2) Quick Select Kth largest element : Worst case O(n^2) ( when tree was
already a bst + if we chos
Better watch this video...
http://www.youtube.com/watch?v=HjPmZuOXkHQ&feature=player_embedded After
20th minute! It'll clear all ypur doubts.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://
Thanks for the elaboration!
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/z2bD7spFbPQJ.
To post to this group, send email to algogeeks@googlegroups.com.
thank u all :)
On Sep 8, 4:44 pm, hashd wrote:
> @Anurag: The input is said to be of unknown and large length ... read it one
> character at a time using a loop like
> while((c=getchar())!=EOF){
> //body
>
>
>
>
>
>
>
> }
--
You received this message because you are subscribed to the Google Gro
mindtree is coming in our college if anybody know the qus. and paper plz
send me...
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send emai
thanx @piyush
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit
mindtree is coming in our college if anybody know the qus. and paper plz
send me.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send em
It depends on the use cases.
If you have less elements of order of( say 100) then even insertion sort can
be a better choice. It's in-place sorting algo and can
perform sorting as it receives the elements like a stream.
If you have large number of elements and all the elements can't be
accommodat
Best for what?
Don
On Sep 8, 12:41 pm, aayush jain wrote:
> which is best sorting tec. n why???
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group,
if list is sorted nd when list is unsorted.
and which one quick sort or merge sort.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this grou
@Praveen: No. Brijesh was correct. Inserting an element into a heap
with k elements is O(log k). This must be done n times, so O(n log k).
Dave
On Sep 8, 12:50 pm, praveen raj wrote:
> @brijesh...Tht would...be... O(klogn)
--
You received this message because you are subscribed to the Goog
Okay. We can do it with min Heap.
1) Build a Min Heap MH of the first k elements (arr[0] to arr[k-1]) of the
given array. O(k)
2) For each element, after the kth element (arr[k] to arr[n-1]), compare it
with root of MH.
a) If the element is greater than the root then make it root and call heapify
Merge sort
Quicksort--number of comparisons and exchanges lesser than heapsort...if
worst case not occurs...
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from
@brijesh...Tht would...be... O(klogn)
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
@Brijesh: Can you help me with a code ? or atleast pseudo code ? How are
you going to keep on inserting the elements ?
Thanks & Regards,
-Rohit
On Thu, Sep 8, 2011 at 10:38 PM, Brijesh wrote:
> make a max heap of size K , and keep inserting all the elements in it.. and
> at last the root will b
which is best sorting tec. n why???
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For mo
very easy qus...which is the best sorting tech. n why?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@g
@sandeep...dont understand... plz give an example...
With regards,
Praveen Raj
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
a
another problem with gets is that although we can read multiword string
but we cannot read multiple strings like with scanf,,
On Thu, Sep 8, 2011 at 10:50 PM, praveen raj wrote:
>
> char str[MAXLINE];
> fp=fopen("ABC.txt","r");
>
> syntax:
>
> fgets(str,MAXLINE,fp);
> With regards,
>
> Praveen
char str[MAXLINE];
fp=fopen("ABC.txt","r");
syntax:
fgets(str,MAXLINE,fp);
With regards,
Praveen Raj
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this
make a max heap of size K , and keep inserting all the elements in it.. and
at last the root will be the k-th largest element ! O(nlogk)
On Thursday, 8 September 2011 22:32:52 UTC+5:30, Sandeep Chugh wrote:
>
> wat abt creating a max heap? and then deleting root element k-1 times..
> after then
make a max heap of size K , and keep inserting all the elements in it.. and
at last the root will be the k-th largest element ! O(nlonk)
On Thursday, 8 September 2011 22:32:52 UTC+5:30, Sandeep Chugh wrote:
>
> wat abt creating a max heap? and then deleting root element k-1 times..
> after then
+1.. please someone share the procedure and questions, topics and all...
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/pmW5D1vnWbwJ.
To post to this group
@Rohit: See, e.g.,
http://en.wikipedia.org/wiki/Selection_algorithm#Linear_general_selection_algorithm_-_Median_of_Medians_algorithm
or
http://jonah.cs.elon.edu/sduvall2/courses/csc331/2006spring/Lectures/Order_statistics.ppt
Dave
On Sep 8, 11:55 am, Rohit jalan wrote:
> How to find out Kth lar
wat abt creating a max heap? and then deleting root element k-1 times..
after then root contains kth largest element
On Thu, Sep 8, 2011 at 10:28 PM, Piyush Kapoor wrote:
> use max heap ,it will take n + k*logn
>
>
> On Thu, Sep 8, 2011 at 10:25 PM, Rohit jalan wrote:
>
>> How to find out Kth
Use the Randomized partition approach of quicksort to find the kth largest
element in the array.
With regards,
Praveen Raj
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To un
use max heap ,it will take n + k*logn
On Thu, Sep 8, 2011 at 10:25 PM, Rohit jalan wrote:
> How to find out Kth largest element in an array ?
>
> --
> Thanks & Regards :
> ROHIT JALAN
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
>
How to find out Kth largest element in an array ?
--
Thanks & Regards :
ROHIT JALAN
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email
Hey guys MS coming to our college (VJTI Mumbai) ...preferably 14-15 Sept
So *whoevere attended recently in past 2-3 months please share format and
questions asked ...*
Give details about - in C/C++ what type of ques asked... etc and* if
possible post questions ..*
And *what areas one need to ho
wht do u mean by tht qn? i didn get it...OS isnt processing any data...it
just simply maintains the imaging & indexing operations...wht do u mean by
managing...? accessing involves use of indexing & seeking to the particular
data point...
On Thu, Sep 8, 2011 at 3:41 PM, bharatkumar bagana <
bagana
guys which is the best site or book to practise backtracking and branch and
bound programs ?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
ht
@Sweety: Thanks! :-)
On Thu, Sep 8, 2011 at 9:28 AM, sweety bhagat wrote:
>
>
> tally solution qstn are subjective it includes appti , c/c++ output ,sql nd
> data structure mailny link list
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm
1 a
2 c
3 b
On Wed, Sep 7, 2011 at 11:08 PM, Mani Bharathi wrote:
> “Kya-Kya” is an island inhabitants of which always answer any question with
> two
> answers , one of which is true and the other is false .
>
> 1.You are walking on a road and came to a park . You ask the inhabitants
> Ram , Laxm
please post the questions after the first round is over...
On Sep 8, 9:35 am, rahulmaximus wrote:
> what the pattern like?
> Any papers or type of topics to stress on would be welcomed ...
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
@Anurag: The input is said to be of unknown and large length ... read it one
character at a time using a loop like
while((c=getchar())!=EOF){
//body
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
using gets we can get buffer over as gets doesn't check about the size input
so it mai go to that area where our stack base pointer(think in memory
layout section) is stored so our programmed doenn't return to orignal state
as address is stored there...so it is dangeroues to use
--
You receiv
@thank u
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this grou
can any one tell me how a processor supports an external hard disk with huge
memory like 1000 TB ?
what are the requirements needed to access a data element in that drive?
--
**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers <=> Save Trees
*BharatKumar Bagana*
**
Thnx Amit...Can any one post some sample ques so that it vl be very useful
??
On Thu, Sep 8, 2011 at 11:41 AM, Amit Gupta wrote:
> Written test of adobe had 3 sections -
> Quant and Analytical section - 45 questions(30 + 15) 45 mins
> 2 coding papers - 1 hr each , 10 ques each
> 1st coding p
AFAIK..no such hard rule ..depends on lot of factors
http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001361223.htm
On Thu, Sep 1, 2011 at 5:49 PM, ravi maggon wrote:
> for what reason?
>
>
> On Thu, Sep 1, 2011 at 5:44 PM, sukran dhawan wrote:
>
>> subquery
>>
index we create for a column on a table, nd when we create that, internally
the indexes, which r key,field values with that column value & probably the
corresponding record addr, r created and stored in some tree structure.
and wen we do a select based on this column value, db 1st searches this
tr
Solution to 3rd question:
Charles: 1st True. 2nd False
Bobby : 1st True, 2nd False
Amar:1st False, 2nd True
Hence Bobby is the chief
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegr
4
On Wed, Sep 7, 2011 at 9:09 PM, Mohit Goel wrote:
> How many processes are created in this snippet?
> Main()
> {
> Fork();
> Fork() && fork () || fork ();
> Fork ();
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to th
ANSWER:
45
On Wed, Sep 7, 2011 at 8:39 PM, Mani Bharathi wrote:
> While traveling at uniform speed. U read a two digit no. after one hr
> the number is reversed order. After another hour the number read is same
> two digit number. What is the average speed?
>
> --
> You received this message bec
explanation would be appreciated
surender
On Thu, Sep 8, 2011 at 12:12 AM, Piyush Grover wrote:
> 4) a and b
>
>
> On Thu, Sep 8, 2011 at 12:08 AM, Piyush Grover
> wrote:
>
>> 1.)a
>> 2.)b
>> 3.)b
>> 4)b
>>
>>
>> On Wed, Sep 7, 2011 at 11:08 PM, Mani Bharathi
>> wrote:
>>
>>> “Kya-Kya” is an i
69 matches
Mail list logo