Programming GAF, I have a question with vectors is there a way to find a size 2 x 2 subvector using the member functions?
You'll have to be more specific. What programming language and/or library are you referring to? What are the dimensions of the original vector?
When you are writing some random code and need some data structure to hold your data, hashtables are pretty much next in line after (dynamic) arrays; they are just very useful and well-performing in general.Why do you say that? Genuine curiosity.
Why do you say that? Genuine curiosity.
When you are writing some random code and need some data structure to hold your data, hashtables are pretty much next in line after (dynamic) arrays; they are just very useful and well-performing in general.
Well aside from just being generally really useful, they've been the answer to at least half of the contrived algorithms questions I've been asked in interviews. They always want to see if you can do stuff in order n time, so traversing linked lists or arrays are usually out by default.
Well aside from just being generally really useful, they've been the answer to at least half of the contrived algorithms questions I've been asked in interviews. They always want to see if you can do stuff in order n time, so traversing linked lists or arrays are usually out by default.
Isn't traversing/iterating through arrays and linked lists O at most?
Pretty much every data structure is O to traverse all elements.
A given algorithm may require you to do more than just traversal, though. The key to hash tables is that for a well-designed hash, the average time for search/insert/delete is O(1), whereas for a linked list the average search time is O, and for an array the insert/delete time is O.
Best of luck. When in doubt, hashtables!
Thanks! It turns out there were no technical or programming questions in this interview, though...it was just a short "screening" interview. I wish they would have done it over the phone, because it was a 90 minute drive both ways.
I did well in the screening, though, from what the interviewer said, and they're going to have me back for the actual technical interview soon. Then I shall hash all the tables for them!
Are you a junior/senior going for this internship?
Best of luck on your 2nd interview!
Thanks.
Have you talked to anybody from the faculty about what they mean by "reducing" the requirements? It could be a much smaller change than you think. It does sounds like it could be moving towards something less 'traditionally computer-sciency' though.
A lot of schools are "theory-heavy" and produce students who can't actually write code. They focus on PhD prep instead of producing programmers who can get jobs.No, I just found out about it earlier today so I haven't had time to talk with anyone about it. That is a good idea though.
It seems to me like they are steering the focus towards an IT professional (systems administrator, etc.) instead of a computer scientist (software engineer, etc.). That wouldn't be too surprising as this college is geared towards working individuals that are returning to finish their degree or get their first degree.
Then again I could be completely wrong about this whole thing.
Edit: my advisor told me that they revised the curriculum based on student feedback and feedback from outside companies. They felt that some of the courses weren't as important to programming, so they were removed as requirements or revised. The upper level math courses are still available, and I can minor in math still, but they are not requirements for the major.
It gives me something to think about. Friday I will be visiting a different college, (more traditional, classes all week instead of only once a week), so I will take that experience into consideration when thinking about where I want to be this fall.
Damn. I am required: Calc I and II, Statistics (intro I and II or applied), Linear Algebra and a math elective (200+) that's not discrete math, plus physics 1 and 2 and their labs.
And of course the only thing I have left after this semester is the math elective :\
A lot of schools are "theory-heavy" and produce students who can't actually write code. They focus on PhD prep instead of producing programmers who can get jobs.
To me the changes sound a lot more like preparing students to get jobs as developers, not as system administrators.
You sound pretty down about the change in direction from your school. Honestly it's probably not going to affect you at all. If you want to leave for other reasons that's one thing, but don't make these changes out to be a scapegoat. Don't have a kneejerk reaction. Changes happen to curriculums constantly.
You know more than me about the situation though.
Damn. I am required: Calc I and II, Statistics (intro I and II or applied), Linear Algebra and a math elective (200+) that's not discrete math, plus physics 1 and 2 and their labs.
And of course the only thing I have left after this semester is the math elective :\
Same here. I was just about to mention how awesome those requirements are.
Hi programming-GAF. I started college a month ago in Computer Engineering in Mexico. I started knowing almost nothing about programming, and I'm getting to know C and C++, also I'm taking linear algebra, calculus and discrete math in this first semester. The thing is, I want to know how classes are in US colleges, because I'm interested on how much of a difference in education there is between here and there. I read that there are colleges that upload videos of some classes (or lectures I think they're called) for free, so which ones would you recommend to watch?
I know this is kind of nonsense, but it blows my mind that in the US college is so expensive and here I'm paying like $100 per semester, and so far, it isn't bad (I think so haha).
am brain farting about this, if someone could help in anyway i'd much appreciate it
(java) i need to increment an integer from 000000001 to 999999999. by 1 each time the method is called.
000000001
000000002
....
I can't think of a simple way to do this, unless there are things built into java that can help?
am brain farting about this, if someone could help in anyway i'd much appreciate it
(java) i need to increment an integer from 000000001 to 999999999. by 1 each time the method is called.
000000001
000000002
....
I can't think of a simple way to do this, unless there are things built into java that can help?
Isn't traversing/iterating through arrays and linked lists O at most?
Pretty much every data structure is O to traverse all elements.
A given algorithm may require you to do more than just traversal, though. The key to hash tables is that for a well-designed hash, the average time for search/insert/delete is O(1), whereas for a linked list the average search time is O, and for an array the insert/delete time is O.
You don't need a method for the single operation 'variable++'...
If you're talking about a loop: for 0 to 999999999 { increment }
And guise hashtables are O(1)....
Holy course load Batman!! How are you still alive taking all those courses at once?
To answer your second question though. MIT, Harvard, and some other schools here have started uploading their classwork so that people can access them for free online.
Here are a couple links:
edX courses
MIT OpenCourseware
Harvard courses through edX
integer++?
You don't need a method for the single operation 'variable++'...
If you're talking about a loop: for 0 to 999999999 { increment }
And guise hashtables are O(1)....
to clarify, I need them in that specific 9 digit format as a string.
000000001
000000002
public String increment(String prev)
{
int bob = Integer.parseString(prev);
bob++;
return Integer.toString(bob);
}
but I don't think that would work (on my phone atm so can't test)
}
the bolded part is just the just the runtime API from nvcc command line.Error 3 error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -G --keep-dir "C:\Users\Praveer\documents\visual studio 2010\Projects\VectorAdd\Debug" -maxrregcount=0 --machine 32 --compile -I -g -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o "Debug\kernel.cu.obj" "C:\Users\Praveer\documents\visual studio 2010\Projects\VectorAdd\VectorAdd\kernel.cu"" exited with code 2.
Error 1 error : declaration is incompatible with "time_t time(time_t *)"
And guise hashtables are O(1)....
My post wasn't clear. Accessing a single value in a hashtable is O(1). For the contrived interview questions I vaguely mentioned, they want you to take a set of data and do something with it. If finding an element is O(1) and you have to do that n times, you get O aas a starting point for the algorithm. If you want to do something to n elements with a worst case access time of n for each, you get O(n^2).
Yeah that would kill the leading zeroes on parsing.
just use:
System.out.format("%09d%n", num); //num is an int
since we're talking about hash tables, thought i'd share a moment i had interviewing a candidate a while back.
somehow the topic of hash tables came up, so i thought i'd ask him some basic questions about their workings.
i asked him what would happen in the event of a hashing collision during insertion, would we lose the value currently held at that position? his answer: definitely, yes.
this position was senior level and for a perl shop, so needless to say it didn't work out.
Being hazy on hash tables and admitting it wouldn't shut the door to most programming summer internships, I think. Being wrong and confident about something this simple = red alert.Damn, for senior level? That's bad even for a summer internship.
Being hazy on hash tables and admitting it wouldn't shut the door to most programming summer internships, I think. Being wrong and confident about something this simple = red alert.
since we're talking about hash tables, thought i'd share a moment i had interviewing a candidate a while back.
somehow the topic of hash tables came up, so i thought i'd ask him some basic questions about their workings.
i asked him what would happen in the event of a hashing collision during insertion, would we lose the value currently held at that position? his answer: definitely, yes.
this position was senior level and for a perl shop, so needless to say it didn't work out.
var table = new Dictionary<int, string>();
table.Add(1, "Hello"); // adds key-value
table.Add(1, "World"); // ArgumentException for same key
var table2 = new Dictionary<int, string>();
table2[1] = "Hello"; // adds key-value
table2[1] = "World"; // writes over existing value
tbh, there are a lot of senior developers who don't know about hash collisions. I recently got a new job so I did a lot of studying and learned all about Java Collections but when asking around at my office, hardly anyone fully understood how a hash table would work on a deeper level.
Do you guys have any tips or insight for workflow for python? I feel like mine is horribly inefficient.
anyone know how atoi() got its name?
I don't mean to be nitpicky, but since we are discussing hashtables in the context of interview advice, where the small details count, I will be.
Hashtables do not always have O(1) access times. The worst-case access time is O.
The average access times are a function of the suitability of your hashing function to the input data set and the size of the hashtable. Ideally, this will result in an O(1) average access time, but it is not guaranteed.