Sort Definition and 152 Threads

  1. J

    MHB When Bubble Sort to sort a list of numbers 7, 12, 5, 22, 13, 32

    Can somebody tell me which example is right when a question that is given to me says to bubble sort a list of numbers 7, 12, 5, 22, 13, 32? I found two examples and one was with a graph that included Original List, Pass 1, Pass 2, Pass 3, Pass 4, Pass, 5, and Pass 6, the numbers with 7 on one...
  2. Doofy

    What sort of wage should I expect once I graduate my PhD?

    I'm a little bit over half way through my PhD (particle physics) at a good UK university and I don't know what I'll do next. So far the only things in my head are "post-doc" or "something else", but I'd like to know roughly what sort of wage you would be happy with if you were in my shoes...
  3. A

    Why insertion sort works better than quick-sort for small data?

    I have seen in books that when number of elements is small ~ 30-40 insertion sort is recommended. Why is that? The worst case of insertion sort is n2 whereas for quick-sort it is nlogn. nlogn beats n2 for all values of n isn't it? Then why?
  4. topsquark

    MHB Earth Rope Challenge: 6m Longer - How High?

    This isn't so much a challenge problem as much as it has a startling (at least I think so) answer. Say we tie a rope around the Earth. Now we are going to cut it and add another 6 meters to it. If we pull the new rope tight (in a circle) how high is the new rope above the Earth's surface...
  5. J

    Java Java question: Need some sort of global variable.

    Just wondering if the Java experts here could help me. As part of a project I'm making a function rand9() that returns a pseudo-random number 0 through 9. The problem is that each time it's called I need a certain number to increment so that it can generate a new (not necessarily different)...
  6. R

    Does the relativity of simultaneity imply a sort of determinism?

    This came up at lunch today when a friend of mine brought up that he had recently watched the Nova episode of Fabric of the Cosmos where they talk about spacetime as a sort of loaf where relative motion has the effect of cutting different angled slices out of the "loaf" of space time (for those...
  7. C

    What sort of atmosphere could a rogue planet have?

    Let's say that a planet of approximately Earth's size - containing, as Earth does, core heat - were tossed out of orbit. Could it maintain any sort of atmosphere, or would all the component gases liquify and freeze, or be gradually lost to space? If it could retain any atmosphere, what gaseous...
  8. S

    Java [Java] what's wrong with my bubble sort algorithms?

    I have 2 possibilities, non of them worked: PD: I am sure that all the methods inside this method(s) are correct and I am sure that the program's GUI is refreshing effectively. public void metodo1() { for (int i=0; i<(perros.size()); i++){ for (int j=perros.size()-1...
  9. T

    What sort of experiments can be doen with Graphite ?

    What sort of experiments can be doen with Graphite ?? I need experiments that can be done for the research of graphite.. GOt any ideas??
  10. T

    Is There a Calculus Relationship Between These Kinematics Equations?

    { y }_{ f }={ y }_{ i }+{ v }_{ yi }t+\frac { 1 }{ 2 } { a }_{ y }{ t }^{ 2 }\\ { v }_{ yf }={ v }_{ yi }+{ a }_{ y }t It almost looks like the second equation is the derivative of the first equation with respect to time.
  11. K

    How to Analyze Bubble Sort Algorithm Efficiency?

    Hello, I need to analyze some bubble sort algorithm and calculate the probability of each conditional statements(if,for,while,ect...) be successful. I can post the algorithms if you need to see them. Thanks in advance
  12. N

    Number of comparisons in an insertion sort

    Homework Statement How many comparisons does the insertion sort use to sort the list n, n-1, ...2, 1? Homework Equations The Attempt at a Solution Insertion sort compares every element with every other element in the list, but I'm unsure what this question is asking. Why does it...
  13. M

    Find the Best Optimization Method for Creating Test Groups - Mike

    I am looking for a term to describe a sort of "optimization" that I am trying to do. Hi everybody, I am a college student who unfortunately is not smart enough to be a math major. But nonetheless I am obsessed with statistics and numbers. I have a question: I need help figuring out a term...
  14. L

    From what I understand, there s some sort of computer calculating pi

    ... and for a long time, I took this for granted, but now I'm starting to wonder how it is doing this. From my knowledge, the only way one could calculate pi is to measure the diameter and radius of a circle, and find the ratio, but to calculate an irrational decimal as thoroughly as we have...
  15. G

    Troubleshooting a Segmentation Fault in a Selection Sort

    please help me with a c code for the merge sort... and i am getting a segmentation fault in running this selection sort,,, please help... #include <stdio.h> int main( ) { int arr[10]; int i,j,temp; for ( i = 0 ; i<10 ; i++ ) { printf("enter the numbers: \n"); scanf("%d \n", arr[i]); } for (...
  16. T

    Could an ~12ft rocket launch some sort of probe into space

    could a large 12ft model rocket be used to launch a probe into space, such as a telescope?
  17. L

    Need help with menu driven search and sort program

    Hello, this is sort of a big program and I wrote out the program, but I'm unsure about a lot of things. The program is supposed to give the user a menu of choices: 1) Fill the array with random numbers. 2) Print the array. 3) Search the array. 4) Sort the array. 5) Quit. Option one is...
  18. D

    Engineering What sort of engineering is best for this?

    I want to work in massive industrial scenarios - power plants, oil refineries, steel mills, oil rigs, etc. Now I know that there are probably multiple that are more specialized for each of these, but is there one engineering that sort of encompasses all of these and would allow one to have a...
  19. M

    Maths for Postgraduate String Theory: Analysis, Algebra, or Topology?

    I admit I don't know anything about string theory (nobody really does at an undergraduate level) but it sounds interesting and seems like something challenging. I am majoring in physics and maths but I am getting to the point in my undergraduate studies where I can begin to specialize more in my...
  20. wukunlin

    What sort of cable connector is this?

    I don't think this is technical enough to post it in EE so I'm hoping someone in my project my supervisor bought this thing, it's power supply uses a cable shown in the attached image, problem is it is about a foot long. For the sake of a tidier work space we are trying to find an extension...
  21. F

    MHB O(nlogn): Exploring the Runtime of Merge Sort

    For megre sort alogirthm the runtime is T(n)=nb+cnlog(n). It's not quite clear to me why this is O(nlogn) is it because b and c are constants?
  22. A

    Is there such a site where you can participate projects of all sort?

    You know, like drawing PCB, coding some C, come up with best chip models? And at the same time, gain experience and learn from others?
  23. R

    How to sort a list alphabetically but ignore numbers?

    I have a list of urls I need to sort but I need to sort them only using the letters in the url? Eg. example.com/174353/a example.com/3452344/c example.com/435322/d example.com/2342/b example.com/23456/e Would be sorted as: example.com/174353/a example.com/2342/b example.com/3452344/c...
  24. E

    Looking for some sort of 'cable quick release'

    I'm working on a design project and I need to find what I would call a 'cable quick release'. Basically, I need to be able to quickly release a cable that has ~3500 pounds of tension in it. Ideally, one would just use a pin you could pull out, but I'm fairly certain that would be difficult if...
  25. S

    Schools How to Pursue Physics After College: Advice Needed

    Hello everyone, Long long ago, I thought of being a physics major. When I came into into college, I had no experience with physics, problem sets, mathematics higher than trigonometry(very little trig), or much science(my school didn't really offer good science classes). I discovered physics...
  26. Saladsamurai

    C/C++ C++:How to Make sort function work with Double and Integer type

    So I have a simple selection sort function written. It takes an array of type double as the array to be sorted. If I declare the array to be of type int in my main program and then pass it to my sSort function, it gets mad. There must be a way that programmers deal with this kind fo stuff. Here...
  27. 1

    Don't know why selection sort isn't working?

    Homework Statement to accept 10 names and print alphabetically Homework Equations The Attempt at a Solution public class n1_s {void main(){ int min,c,q;String t; String n[]={"b","k","a","w","e"}; for(int i=0;i<4;i++) {min=i...
  28. A

    Help Me Debug My Merge Sort Algorithm

    Hi I'm trying to program a merge sort algorithm on python but it just doesn't work! I first implemented a fusion algorithm which takes as arguments a list A divided into 2 sorted sub lists A[p..q] and A[q+1..r]. Fusion then returns the list A completely sorted. This program seems to work...
  29. N

    Where to start? It's been a long time since I've been in any sort of education.

    Hello guys, I'm new to the forums and am in need of some guidance. I left secondary school in 2008 with beyond terrible GCSE's. All my school life I had been an exceptionally hard worker, and had been predicted A's in most of my GCSE's. Then something happened in my life that crushed me...
  30. M

    Bubble sort doesn't stop as expected

    This was written in python as an excersie, it's a terribly inefficient use of python. Still I don't understand why the sort doesn't stop as soon as possible can anyone one point out the error? def bubbleSort (theList): size = len(theList) - 1 while (size > 0): index = 0...
  31. A

    Short easy question, what does this sort of plus minus symbol mean?

    I'm studying for a quantum exam and there is this symbol that looks like an inverted plus minus but the minus is attached to the plus... kind of like _ + but attached. in context: "x ± vt = constant or x = (-/+) + constant." Thanks for any speedy help!
  32. M

    What sort of mathematics for mathematical physics?

    I am hoping to do mathematical or theoretical physics after my undergraduate science degree. I have been advised to do more maths subjects than physics subjects in order to achieve this. I am double majoring in maths and physics and I am just wondering what area of maths I should be focusing on...
  33. A

    Comp Sci How can I fix an error in the insertion sort while loop in a Java program?

    So i haven't done java in about two years, its been a while since I've seen arrays. THe assignment is to fix a program that was given to me. I found one error but in the insertion sort part i can't get it to run the while loop. I can't make any fundamental changes to the program, basically i...
  34. James889

    C Bubble Sort Help | Get Programming Assistance

    Hi, I am trying to write a program that sorts an array of random numbers. Unfortunately, it does not work out as i had hoped, I am getting some strange output. Here's my code: #include <stdio.h> #include <stdlib.h> /* Function Prototypes */ int rand(void); void srand(unsigned...
  35. P

    Analysis of the Binary Insertion Sort algorithm

    Good morning, I implemented the Binary Insertion Sort algorithm in C++, and now I want to analyse its time complexity. This is the Insertion Sort algorithm, but the linear search technique (which is used for locating the position in which to insert a particular integer) is replaced by a binary...
  36. A

    Is there an explicit solution to the equation \sqrt{Ax-x^3}+\sqrt{Bx-x^3}=C?

    Solving a cubic... sort of! Hi, Can the equation \sqrt{Ax-x^3}+\sqrt{Bx-x^3}=C be solved explicitly? All of MathLab, Maple and WolframAlpha seem to give an explicit solution but they don't show how they come to it. I'm afraid they may be missing other possible solutions. Thanks,
  37. O

    Some sort of transform to find the log of a series

    I am trying to write a computer program that involves finding 2 very large numbers (several thousand digits) and dividing them to get a reasonable sized number. the first number is a value of the gamma function, which can be defined as a product and thus easy to reduce with logs (find the sum...
  38. P

    Hey guys,I'm looking for some sort of mosfet/relay/switch that can

    Hey guys, I'm looking for some sort of mosfet/relay/switch that can handle up to 1 milliamp and 8kV. I don't understand the technology very well, but from talking to some people, I know I can put 2 4kV mosfets in series to achieve my 8kV goal. On the other hand, while looking for relays, I...
  39. D

    Using the Insertion Sort algorithm on a linked list

    Homework Statement Hi there, I wish this wasn't my first post but unfortunately, it is. I will try to contribute later in the semester when my workload is less. On to the topic, the problem is I have to implement the insertion sort algorithm on a linked list. I have the algorithm for Java...
  40. S

    Java How to Fix Errors in Alphabetically Sorting Full Names in Java?

    import javax.swing.*; import java.util.Arrays; public class sortSelection { public static void main(String args[]) { String inputString; char temp; inputString = JOptionPane.showInputDialog("Enter Your Name"); char a = inputString.charAt(0); char b =...
  41. J

    Understanding Bubble Sort Algorithms

    Anyone familiar with a bubble sort? and if so how to implement it?
  42. C

    Help Sort My Confusion on dH, TdS and dQ

    I would like to know if someone here can help sort out my confusion... It is easy to derive that dU=TdS-pdV (no particle exchange) Then enthalpy H=U+pV will imply dH=TdS+Vdp That means under a constant temperature (dT=0) and constant pressure (dp=0) situation dH=TdS>(=) dQ Why is it...
  43. P

    Fabricate a sort of home radar/tracking system

    a friend and i plan to design and fabricate a sort of home radar/tracking system.the objective goes like this.there is a dark room and we are flying a remote controlled helicopter(a small one).it is desired that a radar/tracking system placed on the floor should track it,follow it and hit it...
  44. G

    Incline + Spring = Hours of Fun. Sort of.

    Homework Statement A 1.71 kg package is released on a 54.1 deg incline, 4.00m from a long spring with force constant 141 N/m that is attached at the bottom of the incline . The coefficients of friction between the package and the incline are 0.39 and 0.24. The mass of the spring is...
  45. wolram

    Are you the sort of person who sees a new gadget for the home, and

    Are you the sort of person who sees a new gadget for the home, and thinks it's a must have, or are you the type of person who still has such like a none electric can opener.
  46. P

    Is there some sort of state of matter between a liquid and a gas?

    We've all heard of the three states of matter: solids, liquids, and gases. Recently someone told me that there is some sort of state of matter between a liquid and a gas. Does anyone know what he's talking about?
  47. M

    Masters in some sort of Energy discpline

    Masters in some sort of "Energy" discpline Currently I am in the final year of a 3 year degree in Physics, and I have decided I would prefer to do something much more practical. I would like to get into the energy industry, as such I am looking to apply to universities offering Masters...
  48. M

    Integration of a complicated sort

    Homework Statement Here's the original problem in all of its glory... \int_0^{T/2} \,\sin((2\pi(t)/T) - \alpha) \, dt Homework Equations U Substitution Trig identities (possibly) The Attempt at a Solution Using U substitution I've got u=2\pi(t)/T -\alpha Which means that du= 2\pi/T dt...
  49. S

    Statically Indeterminte sort into groups

    Homework Statement A cable supports a cylindrical beam at point B. For the given loading conditions, what type of supports, applied at point A, would improperly constrain the beam, would constrain the beam and make the beam statically determinate, and would constrain the beam and make the beam...
  50. B

    Help me sort my life out? (aka: 'To PhD, or not to PhD?')

    Hey all, I'm wondering if anyone here can help me try and get things straight in my mind about what I'm going to do next. I'm currently studying Part III (the courses in QFT, Symmetries, Strings etc) and already people are starting to talk about PhD applications, since it seems to be assumed...
Back
Top