Skip to content

Thing to remember 3 #78

@SharedMocha

Description

@SharedMocha

Array List -Methods
a.remove(index);
a.add(value) //adds to the end
a.add(index,value); //add at a particular place and move others to right
a.set(index,value); //Dont move anything-just replace
a.clear() //clear arraylist
Collections.sort(arraylist) // sort an array list
Collections.sort(arraylist,i,j) //sort arraylist from a position

Arrays
Arrays.sort(array) //sort an array
Arrays.sort(nums,0,j+1);
Arrays.toString() //Print array

String
A.contains(b) //check if a has b

Iterate on a stack
Stack test = new stack<>();
stack.push(0);
stack.push(1);

Iterator iter = stack.iterator()

while(iter.hasNext()){
println(stack.pop());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions