473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

i am new to C++ these are my assingnments can any one help me how to start and solve

HI all,
Can any one help me here these are my assignments i am new to C++.
Pls help find solution to these

1.Suppose that each row of an nxn array A consists of 1's and 0's such that,in an row of A,all the 1's come before any 0's in that row.Assuming A is already in memory,describe a method running in O(n) time (not O(n^2) time ) for finding the row of A that contains the most 1's.


2.Consider an extend able table that supports both add and remove methods,has defined in the previous exercise.Moreover,suppose we grow the underlined array implementing the table by doubling its capacity any time we need to increase the size of this array,and we shrink the underlined array by half any time the number of (actual) elements in the table dips below N/4,where N is the current capacity of the array show that a sequence of n add and remove methods,starting from an array with capacity N=1,takes O(n) time.

Thanks in Advance
Jan 31 '07 #1
1 1847
r035198x
13,262 8TB
HI all,
Can any one help me here these are my assignments i am new to C++.
Pls help find solution to these

1.Suppose that each row of an nxn array A consists of 1's and 0's such that,in an row of A,all the 1's come before any 0's in that row.Assuming A is already in memory,describe a method running in O(n) time (not O(n^2) time ) for finding the row of A that contains the most 1's.


2.Consider an extend able table that supports both add and remove methods,has defined in the previous exercise.Moreover,suppose we grow the underlined array implementing the table by doubling its capacity any time we need to increase the size of this array,and we shrink the underlined array by half any time the number of (actual) elements in the table dips below N/4,where N is the current capacity of the array show that a sequence of n add and remove methods,starting from an array with capacity N=1,takes O(n) time.

Thanks in Advance
What have you done so far?
Jan 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cs | last post by:
I have a windows service that on the start method it launches a BackGround thread, and I am not certain if this is the issue. My problem is that my service never seems to finish starting, the...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
7
by: Mike | last post by:
So, I've been trying to do "MyFirstVBWebApp" and I am hitting numerous roadblocks. After much google'ing, here is what I have done (XP Pro SP1, IIS 5.1) 1. Uninstalled IIS 2. renamed the...
5
by: SiD` | last post by:
when starting a windows service writte in vb.net, a messagebox appears: cannot start service from the command line or a debugger. A windows service must first be installed using installutil.exe ...
8
by: Sunny123 | last post by:
hello, i am usung the following code in C++ std::cout<<"\nDo You Want To Solve Another Quadratic Equation?\nYes(y==Y) No(n==N): "; fflush(stdin); // flush input buffer int sel =...
7
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
1
by: yingzaji | last post by:
hi I was wondering about the odeint function in scipy. While I was solving the Van der pol equations, I found the function odeint is not suitable. I know there are some differences between...
0
by: yingzaji | last post by:
hi I was wondering about the odeint function in scipy. While I was solving the Van der pol equations, I found the function odeint is not suitable. I know there are some differences between...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.