Search Results

Search found 12 results on 1 pages for 'matin1234'.

Page 1/1 | 1 

  • about Randomized-select algorithm

    - by matin1234
    Hi I have this array A = <3,2,9,0,7,5,4,8,6,1> and I want to write all its worst partitions are these correct?thanks a1 = <0,2,9,3,7,5,4,8,6,1> a2 = <1,9,3,7,5,4,8,6,2> a3 = <2,3,7,5,4,8,6,9> a4 = <3,7,5,4,8,6,9> a5 = <4,5,7,8,6,9> a6 = <5,7,8,6,9> a7 = <6,8,7,9> a8 = <7,8,9> a9 = <8,9> a10 = <9>

    Read the article

  • I need an answer book of Michael Mannino [closed]

    - by matin1234
    Hi I want to do all problems of database development application and design book of Michael Mannino but really I don't know the correct answer of them .I have searched a lot for downloading the answer book but I couldn't find it ,please help me that how can I find it or is there any other book with this subject that has answer for its problem.(I need a link) thanks

    Read the article

  • it means quick-select algorithm?

    - by matin1234
    Hi, I have a question from my homework. I think my teacher needs an algorithm like quick select for this question is this correct? The question: Following a program (Subroutine) as a "black box" is given (for example, inside it is not clear and we do not even inside it) with the worst case linear time, can find the middle of n elements. Using this black box, get a simple linear algorithm that takes input i and find the element which its rank is equal to i (among the n elements) Thanks.

    Read the article

  • about Master theorem

    - by matin1234
    Hi this is the link http://www.cs.mcgill.ca/~cs251/OldCourses/1997/topic5/ is written that for T(n)<=2n+T(n/3)+T(n/3) the T(n) is not O(n) but with master theorem we can use case 3 and we can say that its T(n) is theta(n) please help me! thanks how can we prove that T(n) is not O(n)

    Read the article

  • why it throws java.lang.classCastException

    - by matin1234
    Hi this is my class and I want to sort my stack but it will throw an exception please help me thanks! public class jj { public static void main(String[] args){ Stack<Integer> s = new ImplimentingAStackUsingAnArrayOfAGivenSizeN(5); s.push(1); s.push(3); s.push(5); s.push(2); s.push(4); Collections.sort((List<Integer>) (s)); System.out.println(s); while (!s.isEmpty()) { System.out.println(s.pop()); } } } the stack traces: run: Exception in thread "main" java.lang.ClassCastException: datastructurechapter5.ImplimentingAStackUsingAnArrayOfAGivenSizeN cannot be cast to java.util.List at datastructurechapter5.jj.main(jj.java:24) `Collections.sort((List<Integer>) (s));` Java Result: 1 BUILD SUCCESSFUL (total time: 2 seconds)

    Read the article

  • about Quick Sort

    - by matin1234
    Hi I have written this code but it will print these stack traces in the console please help me thanks! (Aslo "p" and "q" are the first and last index of our array ,respectively) public class JavaQuickSort { public static void QuickSort(int A[], int p, int q) { int i, last = 0; Random rand = new Random(); if (q < 1) { return; } **swap(A, p, rand.nextInt() % (q+1));** for (i = p + 1; i <= q; i++) { if (A[i] < A[p]) { swap(A, ++last, i); } } swap(A, p, last); QuickSort(A, p, last - 1); QuickSort(A, last + 1, q); } private static void swap(int[] A, int i, int j) { int temp; temp = A[i]; **A[i] = A[j];** A[j] = temp; } public static void main(String[] args){ int[] A = {2,5,7,3,9,0,1,6,8}; **QuickSort(A, 0,8 );** System.out.println(Arrays.toString(A)); } } the Stack traces : run: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -3 at JavaQuickSort.swap(JavaQuickSort.java:38) at JavaQuickSort.QuickSort(JavaQuickSort.java:22) at JavaQuickSort.main(JavaQuickSort.java:45) Java Result: 1 BUILD SUCCESSFUL (total time: 2 seconds) I also bold those statements that cause these stack traces. like == ** ...**

    Read the article

  • about Select algorithm

    - by matin1234
    Hi I have read about the select algorithm and I have a question maybe it looks silly!!! but why we consider the array as groups of 5 elements ?? can we consider it with 7 or 3 elements??thanks

    Read the article

  • about Sorting Algorithms

    - by matin1234
    Hi I want to know that we always use Sorting algorithm like (Insertion Sort or Merge Sort,...) just for lists and arrays?? and we do not use these algorithms for stack or queue ??? thanks

    Read the article

  • implementation of a queue using a circular array

    - by matin1234
    Hi I have found these algorithms in the internet but I can not understand that why in the enqueue method we compare size with N-1??? please help me thanks!! Algorithm size(): return (N-f+r)mod N Algorithm enqueue(e): if size()=N-1 then throw a FullQueueException Q[r]<---e r<----(r+1)mod N

    Read the article

1